From 30fb8e8a50c3fc8044053ae056f5b9b34c00b941 Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Sat, 16 Aug 2014 14:23:07 +0200 Subject: [PATCH] Patch regarding Issue #774 (SELECT is redundant in case of LOAD_FILE) --- plugins/dbms/mysql/filesystem.py | 2 +- plugins/generic/filesystem.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/dbms/mysql/filesystem.py b/plugins/dbms/mysql/filesystem.py index 0be2fd0bd..4944a9c5e 100644 --- a/plugins/dbms/mysql/filesystem.py +++ b/plugins/dbms/mysql/filesystem.py @@ -29,7 +29,7 @@ class Filesystem(GenericFilesystem): infoMsg = "fetching file: '%s'" % rFile logger.info(infoMsg) - result = inject.getValue("SELECT HEX(LOAD_FILE('%s'))" % rFile, charsetType=CHARSET_TYPE.HEXADECIMAL) + result = inject.getValue("HEX(LOAD_FILE('%s'))" % rFile, charsetType=CHARSET_TYPE.HEXADECIMAL) return result diff --git a/plugins/generic/filesystem.py b/plugins/generic/filesystem.py index 11617ae98..18df285d1 100644 --- a/plugins/generic/filesystem.py +++ b/plugins/generic/filesystem.py @@ -38,7 +38,7 @@ class Filesystem: def _checkFileLength(self, localFile, remoteFile, fileRead=False): if Backend.isDbms(DBMS.MYSQL): - lengthQuery = "SELECT LENGTH(LOAD_FILE('%s'))" % remoteFile + lengthQuery = "LENGTH(LOAD_FILE('%s'))" % remoteFile elif Backend.isDbms(DBMS.PGSQL) and not fileRead: lengthQuery = "SELECT LENGTH(data) FROM pg_largeobject WHERE loid=%d" % self.oid