From 19e1217db2e534d81abfd11fd4bed18516828bf8 Mon Sep 17 00:00:00 2001 From: Gwenael Gallon Date: Sat, 7 Feb 2015 11:17:08 +0100 Subject: Fix unreachable code --- system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php | 10 +++++----- system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) (limited to 'system/database/drivers/pdo') diff --git a/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php b/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php index c8d7c770d..09b48f124 100644 --- a/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php +++ b/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php @@ -154,17 +154,17 @@ class CI_DB_pdo_dblib_driver extends CI_DB_pdo_driver { */ protected function _list_tables($prefix_limit = FALSE) { - return 'SELECT '.$this->escape_identifiers('name') - .' FROM '.$this->escape_identifiers('sysobjects') - .' WHERE '.$this->escape_identifiers('type')." = 'U'"; + $sql = 'SELECT '.$this->escape_identifiers('name') + .' FROM '.$this->escape_identifiers('sysobjects') + .' WHERE '.$this->escape_identifiers('type')." = 'U'"; if ($prefix_limit === TRUE && $this->dbprefix !== '') { $sql .= ' AND '.$this->escape_identifiers('name')." LIKE '".$this->escape_like_str($this->dbprefix)."%' " - .sprintf($this->_like_escape_str, $this->_like_escape_chr); + .sprintf($this->_like_escape_str, $this->_like_escape_chr); } - return $sql.' ORDER BY '.$this->escape_identifiers('name'); + return $sql .= ' ORDER BY '.$this->escape_identifiers('name'); } // -------------------------------------------------------------------- diff --git a/system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php b/system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php index b5bdbf91a..d366d119c 100644 --- a/system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php +++ b/system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php @@ -183,17 +183,17 @@ class CI_DB_pdo_sqlsrv_driver extends CI_DB_pdo_driver { */ protected function _list_tables($prefix_limit = FALSE) { - return 'SELECT '.$this->escape_identifiers('name') - .' FROM '.$this->escape_identifiers('sysobjects') - .' WHERE '.$this->escape_identifiers('type')." = 'U'"; + $sql = 'SELECT '.$this->escape_identifiers('name') + .' FROM '.$this->escape_identifiers('sysobjects') + .' WHERE '.$this->escape_identifiers('type')." = 'U'"; if ($prefix_limit === TRUE && $this->dbprefix !== '') { $sql .= ' AND '.$this->escape_identifiers('name')." LIKE '".$this->escape_like_str($this->dbprefix)."%' " - .sprintf($this->_like_escape_str, $this->_like_escape_chr); + .sprintf($this->_like_escape_str, $this->_like_escape_chr); } - return $sql.' ORDER BY '.$this->escape_identifiers('name'); + return $sql .= ' ORDER BY '.$this->escape_identifiers('name'); } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b From 3a486f19dfe79378d21c6b45579923cc86be0cb5 Mon Sep 17 00:00:00 2001 From: Gwenael Gallon Date: Sat, 7 Feb 2015 19:08:44 +0100 Subject: Revert indentation --- system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php | 8 ++++---- system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'system/database/drivers/pdo') diff --git a/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php b/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php index 09b48f124..c6ef96307 100644 --- a/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php +++ b/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php @@ -155,16 +155,16 @@ class CI_DB_pdo_dblib_driver extends CI_DB_pdo_driver { protected function _list_tables($prefix_limit = FALSE) { $sql = 'SELECT '.$this->escape_identifiers('name') - .' FROM '.$this->escape_identifiers('sysobjects') - .' WHERE '.$this->escape_identifiers('type')." = 'U'"; + .' FROM '.$this->escape_identifiers('sysobjects') + .' WHERE '.$this->escape_identifiers('type')." = 'U'"; if ($prefix_limit === TRUE && $this->dbprefix !== '') { $sql .= ' AND '.$this->escape_identifiers('name')." LIKE '".$this->escape_like_str($this->dbprefix)."%' " - .sprintf($this->_like_escape_str, $this->_like_escape_chr); + .sprintf($this->_like_escape_str, $this->_like_escape_chr); } - return $sql .= ' ORDER BY '.$this->escape_identifiers('name'); + return $sql .' ORDER BY '.$this->escape_identifiers('name'); } // -------------------------------------------------------------------- diff --git a/system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php b/system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php index d366d119c..eb0777316 100644 --- a/system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php +++ b/system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php @@ -184,16 +184,16 @@ class CI_DB_pdo_sqlsrv_driver extends CI_DB_pdo_driver { protected function _list_tables($prefix_limit = FALSE) { $sql = 'SELECT '.$this->escape_identifiers('name') - .' FROM '.$this->escape_identifiers('sysobjects') - .' WHERE '.$this->escape_identifiers('type')." = 'U'"; + .' FROM '.$this->escape_identifiers('sysobjects') + .' WHERE '.$this->escape_identifiers('type')." = 'U'"; if ($prefix_limit === TRUE && $this->dbprefix !== '') { $sql .= ' AND '.$this->escape_identifiers('name')." LIKE '".$this->escape_like_str($this->dbprefix)."%' " - .sprintf($this->_like_escape_str, $this->_like_escape_chr); + .sprintf($this->_like_escape_str, $this->_like_escape_chr); } - return $sql .= ' ORDER BY '.$this->escape_identifiers('name'); + return $sql .' ORDER BY '.$this->escape_identifiers('name'); } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b From 96901ff3849c19351c7382689e6a970629586aae Mon Sep 17 00:00:00 2001 From: Gwenael Gallon Date: Sat, 7 Feb 2015 19:12:56 +0100 Subject: Remove unnecessary return --- system/database/drivers/pdo/subdrivers/pdo_cubrid_driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/drivers/pdo') diff --git a/system/database/drivers/pdo/subdrivers/pdo_cubrid_driver.php b/system/database/drivers/pdo/subdrivers/pdo_cubrid_driver.php index 98ac89f3d..5d74f57a7 100644 --- a/system/database/drivers/pdo/subdrivers/pdo_cubrid_driver.php +++ b/system/database/drivers/pdo/subdrivers/pdo_cubrid_driver.php @@ -113,7 +113,7 @@ class CI_DB_pdo_cubrid_driver extends CI_DB_pdo_driver { if ($prefix_limit === TRUE && $this->dbprefix !== '') { - return $sql." LIKE '".$this->escape_like_str($this->dbprefix)."%'"; + $sql ." LIKE '".$this->escape_like_str($this->dbprefix)."%'"; } return $sql; -- cgit v1.2.3-24-g4f1b From 3053ded760a9657bdc7b935beb61d2f632859928 Mon Sep 17 00:00:00 2001 From: Gwenael Gallon Date: Sat, 7 Feb 2015 19:17:39 +0100 Subject: Remove unnecessary return --- system/database/drivers/pdo/subdrivers/pdo_firebird_driver.php | 2 +- system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php | 2 +- system/database/drivers/pdo/subdrivers/pdo_oci_driver.php | 2 +- system/database/drivers/pdo/subdrivers/pdo_odbc_driver.php | 2 +- system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php | 2 +- system/database/drivers/pdo/subdrivers/pdo_sqlite_driver.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'system/database/drivers/pdo') diff --git a/system/database/drivers/pdo/subdrivers/pdo_firebird_driver.php b/system/database/drivers/pdo/subdrivers/pdo_firebird_driver.php index 3bd5c9354..bb2e28280 100644 --- a/system/database/drivers/pdo/subdrivers/pdo_firebird_driver.php +++ b/system/database/drivers/pdo/subdrivers/pdo_firebird_driver.php @@ -120,7 +120,7 @@ class CI_DB_pdo_firebird_driver extends CI_DB_pdo_driver { if ($prefix_limit === TRUE && $this->dbprefix !== '') { - return $sql.' AND "RDB$RELATION_NAME" LIKE \''.$this->escape_like_str($this->dbprefix)."%' " + $sql .' AND "RDB$RELATION_NAME" LIKE \''.$this->escape_like_str($this->dbprefix)."%' " .sprintf($this->_like_escape_str, $this->_like_escape_chr); } diff --git a/system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php b/system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php index 67dc5f5ec..8065b367c 100644 --- a/system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php +++ b/system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php @@ -170,7 +170,7 @@ class CI_DB_pdo_mysql_driver extends CI_DB_pdo_driver { if ($prefix_limit === TRUE && $this->dbprefix !== '') { - return $sql." LIKE '".$this->escape_like_str($this->dbprefix)."%'"; + $sql ." LIKE '".$this->escape_like_str($this->dbprefix)."%'"; } return $sql; diff --git a/system/database/drivers/pdo/subdrivers/pdo_oci_driver.php b/system/database/drivers/pdo/subdrivers/pdo_oci_driver.php index d17e311f7..c85a4a235 100644 --- a/system/database/drivers/pdo/subdrivers/pdo_oci_driver.php +++ b/system/database/drivers/pdo/subdrivers/pdo_oci_driver.php @@ -143,7 +143,7 @@ class CI_DB_pdo_oci_driver extends CI_DB_pdo_driver { if ($prefix_limit === TRUE && $this->dbprefix !== '') { - return $sql.' WHERE "TABLE_NAME" LIKE \''.$this->escape_like_str($this->dbprefix)."%' " + $sql .' WHERE "TABLE_NAME" LIKE \''.$this->escape_like_str($this->dbprefix)."%' " .sprintf($this->_like_escape_str, $this->_like_escape_chr); } diff --git a/system/database/drivers/pdo/subdrivers/pdo_odbc_driver.php b/system/database/drivers/pdo/subdrivers/pdo_odbc_driver.php index 51c70b630..ab471d6fd 100644 --- a/system/database/drivers/pdo/subdrivers/pdo_odbc_driver.php +++ b/system/database/drivers/pdo/subdrivers/pdo_odbc_driver.php @@ -174,7 +174,7 @@ class CI_DB_pdo_odbc_driver extends CI_DB_pdo_driver { if ($prefix_limit !== FALSE && $this->dbprefix !== '') { - return $sql." AND table_name LIKE '".$this->escape_like_str($this->dbprefix)."%' " + $sql ." AND table_name LIKE '".$this->escape_like_str($this->dbprefix)."%' " .sprintf($this->_like_escape_str, $this->_like_escape_chr); } diff --git a/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php b/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php index 2dd41ca87..11decab92 100644 --- a/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php +++ b/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php @@ -228,7 +228,7 @@ class CI_DB_pdo_pgsql_driver extends CI_DB_pdo_driver { if ($prefix_limit === TRUE && $this->dbprefix !== '') { - return $sql.' AND "table_name" LIKE \'' + $sql .' AND "table_name" LIKE \'' .$this->escape_like_str($this->dbprefix)."%' " .sprintf($this->_like_escape_str, $this->_like_escape_chr); } diff --git a/system/database/drivers/pdo/subdrivers/pdo_sqlite_driver.php b/system/database/drivers/pdo/subdrivers/pdo_sqlite_driver.php index f07f49f84..e25bec067 100644 --- a/system/database/drivers/pdo/subdrivers/pdo_sqlite_driver.php +++ b/system/database/drivers/pdo/subdrivers/pdo_sqlite_driver.php @@ -111,7 +111,7 @@ class CI_DB_pdo_sqlite_driver extends CI_DB_pdo_driver { if ($prefix_limit === TRUE && $this->dbprefix !== '') { - return $sql.' AND "NAME" LIKE \''.$this->escape_like_str($this->dbprefix)."%' " + $sql .' AND "NAME" LIKE \''.$this->escape_like_str($this->dbprefix)."%' " .sprintf($this->_like_escape_str, $this->_like_escape_chr); } -- cgit v1.2.3-24-g4f1b From b4495898cacbaa1807da6f2a2117cf450fc4926c Mon Sep 17 00:00:00 2001 From: Gwenael Gallon Date: Sun, 8 Feb 2015 00:18:37 +0100 Subject: Revert "Remove unnecessary return" This reverts commit 3053ded760a9657bdc7b935beb61d2f632859928. --- system/database/drivers/pdo/subdrivers/pdo_firebird_driver.php | 2 +- system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php | 2 +- system/database/drivers/pdo/subdrivers/pdo_oci_driver.php | 2 +- system/database/drivers/pdo/subdrivers/pdo_odbc_driver.php | 2 +- system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php | 2 +- system/database/drivers/pdo/subdrivers/pdo_sqlite_driver.php | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'system/database/drivers/pdo') diff --git a/system/database/drivers/pdo/subdrivers/pdo_firebird_driver.php b/system/database/drivers/pdo/subdrivers/pdo_firebird_driver.php index bb2e28280..3bd5c9354 100644 --- a/system/database/drivers/pdo/subdrivers/pdo_firebird_driver.php +++ b/system/database/drivers/pdo/subdrivers/pdo_firebird_driver.php @@ -120,7 +120,7 @@ class CI_DB_pdo_firebird_driver extends CI_DB_pdo_driver { if ($prefix_limit === TRUE && $this->dbprefix !== '') { - $sql .' AND "RDB$RELATION_NAME" LIKE \''.$this->escape_like_str($this->dbprefix)."%' " + return $sql.' AND "RDB$RELATION_NAME" LIKE \''.$this->escape_like_str($this->dbprefix)."%' " .sprintf($this->_like_escape_str, $this->_like_escape_chr); } diff --git a/system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php b/system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php index 8065b367c..67dc5f5ec 100644 --- a/system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php +++ b/system/database/drivers/pdo/subdrivers/pdo_mysql_driver.php @@ -170,7 +170,7 @@ class CI_DB_pdo_mysql_driver extends CI_DB_pdo_driver { if ($prefix_limit === TRUE && $this->dbprefix !== '') { - $sql ." LIKE '".$this->escape_like_str($this->dbprefix)."%'"; + return $sql." LIKE '".$this->escape_like_str($this->dbprefix)."%'"; } return $sql; diff --git a/system/database/drivers/pdo/subdrivers/pdo_oci_driver.php b/system/database/drivers/pdo/subdrivers/pdo_oci_driver.php index c85a4a235..d17e311f7 100644 --- a/system/database/drivers/pdo/subdrivers/pdo_oci_driver.php +++ b/system/database/drivers/pdo/subdrivers/pdo_oci_driver.php @@ -143,7 +143,7 @@ class CI_DB_pdo_oci_driver extends CI_DB_pdo_driver { if ($prefix_limit === TRUE && $this->dbprefix !== '') { - $sql .' WHERE "TABLE_NAME" LIKE \''.$this->escape_like_str($this->dbprefix)."%' " + return $sql.' WHERE "TABLE_NAME" LIKE \''.$this->escape_like_str($this->dbprefix)."%' " .sprintf($this->_like_escape_str, $this->_like_escape_chr); } diff --git a/system/database/drivers/pdo/subdrivers/pdo_odbc_driver.php b/system/database/drivers/pdo/subdrivers/pdo_odbc_driver.php index ab471d6fd..51c70b630 100644 --- a/system/database/drivers/pdo/subdrivers/pdo_odbc_driver.php +++ b/system/database/drivers/pdo/subdrivers/pdo_odbc_driver.php @@ -174,7 +174,7 @@ class CI_DB_pdo_odbc_driver extends CI_DB_pdo_driver { if ($prefix_limit !== FALSE && $this->dbprefix !== '') { - $sql ." AND table_name LIKE '".$this->escape_like_str($this->dbprefix)."%' " + return $sql." AND table_name LIKE '".$this->escape_like_str($this->dbprefix)."%' " .sprintf($this->_like_escape_str, $this->_like_escape_chr); } diff --git a/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php b/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php index 11decab92..2dd41ca87 100644 --- a/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php +++ b/system/database/drivers/pdo/subdrivers/pdo_pgsql_driver.php @@ -228,7 +228,7 @@ class CI_DB_pdo_pgsql_driver extends CI_DB_pdo_driver { if ($prefix_limit === TRUE && $this->dbprefix !== '') { - $sql .' AND "table_name" LIKE \'' + return $sql.' AND "table_name" LIKE \'' .$this->escape_like_str($this->dbprefix)."%' " .sprintf($this->_like_escape_str, $this->_like_escape_chr); } diff --git a/system/database/drivers/pdo/subdrivers/pdo_sqlite_driver.php b/system/database/drivers/pdo/subdrivers/pdo_sqlite_driver.php index e25bec067..f07f49f84 100644 --- a/system/database/drivers/pdo/subdrivers/pdo_sqlite_driver.php +++ b/system/database/drivers/pdo/subdrivers/pdo_sqlite_driver.php @@ -111,7 +111,7 @@ class CI_DB_pdo_sqlite_driver extends CI_DB_pdo_driver { if ($prefix_limit === TRUE && $this->dbprefix !== '') { - $sql .' AND "NAME" LIKE \''.$this->escape_like_str($this->dbprefix)."%' " + return $sql.' AND "NAME" LIKE \''.$this->escape_like_str($this->dbprefix)."%' " .sprintf($this->_like_escape_str, $this->_like_escape_chr); } -- cgit v1.2.3-24-g4f1b From cf932175c43a1003ac6b41893c2761b6685e6b90 Mon Sep 17 00:00:00 2001 From: Gwenael Gallon Date: Sun, 8 Feb 2015 00:18:43 +0100 Subject: Revert "Remove unnecessary return" This reverts commit 96901ff3849c19351c7382689e6a970629586aae. --- system/database/drivers/pdo/subdrivers/pdo_cubrid_driver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'system/database/drivers/pdo') diff --git a/system/database/drivers/pdo/subdrivers/pdo_cubrid_driver.php b/system/database/drivers/pdo/subdrivers/pdo_cubrid_driver.php index 5d74f57a7..98ac89f3d 100644 --- a/system/database/drivers/pdo/subdrivers/pdo_cubrid_driver.php +++ b/system/database/drivers/pdo/subdrivers/pdo_cubrid_driver.php @@ -113,7 +113,7 @@ class CI_DB_pdo_cubrid_driver extends CI_DB_pdo_driver { if ($prefix_limit === TRUE && $this->dbprefix !== '') { - $sql ." LIKE '".$this->escape_like_str($this->dbprefix)."%'"; + return $sql." LIKE '".$this->escape_like_str($this->dbprefix)."%'"; } return $sql; -- cgit v1.2.3-24-g4f1b From 01e04a6125cfe280c15194cc11bc43a611d2c59b Mon Sep 17 00:00:00 2001 From: Gwenael Gallon Date: Sun, 8 Feb 2015 10:08:50 +0100 Subject: Deleted spaces --- system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php | 2 +- system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'system/database/drivers/pdo') diff --git a/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php b/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php index c6ef96307..844ffab8f 100644 --- a/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php +++ b/system/database/drivers/pdo/subdrivers/pdo_dblib_driver.php @@ -164,7 +164,7 @@ class CI_DB_pdo_dblib_driver extends CI_DB_pdo_driver { .sprintf($this->_like_escape_str, $this->_like_escape_chr); } - return $sql .' ORDER BY '.$this->escape_identifiers('name'); + return $sql.' ORDER BY '.$this->escape_identifiers('name'); } // -------------------------------------------------------------------- diff --git a/system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php b/system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php index eb0777316..f8ae5f6db 100644 --- a/system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php +++ b/system/database/drivers/pdo/subdrivers/pdo_sqlsrv_driver.php @@ -193,7 +193,7 @@ class CI_DB_pdo_sqlsrv_driver extends CI_DB_pdo_driver { .sprintf($this->_like_escape_str, $this->_like_escape_chr); } - return $sql .' ORDER BY '.$this->escape_identifiers('name'); + return $sql.' ORDER BY '.$this->escape_identifiers('name'); } // -------------------------------------------------------------------- -- cgit v1.2.3-24-g4f1b