]> source.dussan.org Git - nextcloud-server.git/commitdiff
Move query processing after the check for prepared statement cache
authorBart Visscher <bartv@thisnet.nl>
Wed, 7 Aug 2013 16:21:49 +0000 (18:21 +0200)
committerBart Visscher <bartv@thisnet.nl>
Wed, 7 Aug 2013 16:21:49 +0000 (18:21 +0200)
lib/db/connection.php

index 7f207ff76ecdb02cb20ec1bc3acc352c0bf9231b..24466d7bddd422f5f161566d1f23452e05fce2b1 100644 (file)
@@ -62,9 +62,6 @@ class Connection extends \Doctrine\DBAL\Connection {
         * @return \Doctrine\DBAL\Driver\Statement The prepared statement.
         */
        public function prepare( $statement, $limit=null, $offset=null ) {
-               $statement = $this->replaceTablePrefix($statement);
-               $statement = $this->adapter->fixupStatement($statement);
-
                if ($limit === -1) {
                        $limit = null;
                }
@@ -76,7 +73,10 @@ class Connection extends \Doctrine\DBAL\Connection {
                                return $this->preparedQueries[$statement];
                        }
                }
-               if(\OC_Config::getValue( "log_query", false)) {
+               $statement = $this->replaceTablePrefix($statement);
+               $statement = $this->adapter->fixupStatement($statement);
+
+               if(\OC_Config::getValue( 'log_query', false)) {
                        \OC_Log::write('core', 'DB prepare : '.$statement, \OC_Log::DEBUG);
                }
                $result = parent::prepare($statement);