cvs: pear /MDB2/MDB2/Driver/Reverse ibase.php mssql.php mysql.php mysqli.php oci8.php sqlite.php
| From: | Lukas Smith | Date: | Thu, 23 Mar 2006 12:30:34 +0000 |
| Subject: | cvs: pear /MDB2/MDB2/Driver/Reverse ibase.php mssql.php mysql.php mysqli.php oci8.php sqlite.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-39289@lists.php.net to get a copy of this message | ||
lsmith Thu Mar 23 12:30:34 2006 UTC
Modified files:
/pear/MDB2/MDB2/Driver/Reverse ibase.php mssql.php mysql.php
mysqli.php oci8.php sqlite.php
Log:
- properly quote table names in tableInfo() (related to bug #6573)
http://cvs.php.net/viewcvs.cgi/pear/MDB2/MDB2/Driver/Reverse/ibase.php?r1=1.41&r2=1.42&diff_format=u
Index: pear/MDB2/MDB2/Driver/Reverse/ibase.php
diff -u pear/MDB2/MDB2/Driver/Reverse/ibase.php:1.41 pear/MDB2/MDB2/Driver/Reverse/ibase.php:1.42
--- pear/MDB2/MDB2/Driver/Reverse/ibase.php:1.41 Wed Mar 1 12:15:33 2006
+++ pear/MDB2/MDB2/Driver/Reverse/ibase.php Thu Mar 23 12:30:34 2006
@@ -42,7 +42,7 @@
// | Author: Lorenzo Alberton <l.alberton@quipo.it> |
// +----------------------------------------------------------------------+
//
-// $Id: ibase.php,v 1.41 2006/03/01 12:15:33 lsmith Exp $
+// $Id: ibase.php,v 1.42 2006/03/23 12:30:34 lsmith Exp $
//
require_once 'MDB2/Driver/Reverse/Common.php';
@@ -378,7 +378,7 @@
* Probably received a table name.
* Create a result resource identifier.
*/
- $id = $db->_doQuery("SELECT * FROM $result WHERE 1=0", false);
+ $id = $db->_doQuery('SELECT * FROM
'.$db->quoteIdentifier($result).' WHERE 1=0', false);
if (PEAR::isError($id)) {
return $id;
}
http://cvs.php.net/viewcvs.cgi/pear/MDB2/MDB2/Driver/Reverse/mssql.php?r1=1.22&r2=1.23&diff_format=u
Index: pear/MDB2/MDB2/Driver/Reverse/mssql.php
diff -u pear/MDB2/MDB2/Driver/Reverse/mssql.php:1.22 pear/MDB2/MDB2/Driver/Reverse/mssql.php:1.23
--- pear/MDB2/MDB2/Driver/Reverse/mssql.php:1.22 Tue Mar 14 22:38:02 2006
+++ pear/MDB2/MDB2/Driver/Reverse/mssql.php Thu Mar 23 12:30:34 2006
@@ -42,7 +42,7 @@
// | Author: Lukas Smith <smith@pooteeweet.org> |
// +----------------------------------------------------------------------+
//
-// $Id: mssql.php,v 1.22 2006/03/14 22:38:02 davidc Exp $
+// $Id: mssql.php,v 1.23 2006/03/23 12:30:34 lsmith Exp $
//
require_once 'MDB2/Driver/Reverse/Common.php';
@@ -89,7 +89,7 @@
* Probably received a table name.
* Create a result resource identifier.
*/
- $id = $db->_doQuery("SELECT TOP 0 * FROM $result", false);
+ $id = $db->_doQuery('SELECT TOP 0 * FROM
'.$db->quoteIdentifier($result), false);
if (PEAR::isError($id)) {
return $id;
}
http://cvs.php.net/viewcvs.cgi/pear/MDB2/MDB2/Driver/Reverse/mysql.php?r1=1.45&r2=1.46&diff_format=u
Index: pear/MDB2/MDB2/Driver/Reverse/mysql.php
diff -u pear/MDB2/MDB2/Driver/Reverse/mysql.php:1.45 pear/MDB2/MDB2/Driver/Reverse/mysql.php:1.46
--- pear/MDB2/MDB2/Driver/Reverse/mysql.php:1.45 Wed Mar 1 23:16:54 2006
+++ pear/MDB2/MDB2/Driver/Reverse/mysql.php Thu Mar 23 12:30:34 2006
@@ -42,7 +42,7 @@
// | Author: Lukas Smith <smith@pooteeweet.org> |
// +----------------------------------------------------------------------+
//
-// $Id: mysql.php,v 1.45 2006/03/01 23:16:54 lsmith Exp $
+// $Id: mysql.php,v 1.46 2006/03/23 12:30:34 lsmith Exp $
//
require_once 'MDB2/Driver/Reverse/Common.php';
@@ -299,7 +299,7 @@
* Probably received a table name.
* Create a result resource identifier.
*/
- $id = $db->_doQuery("SELECT * FROM $result LIMIT 0", false);
+ $id = $db->_doQuery('SELECT * FROM
'.$db->quoteIdentifier($result).' LIMIT 0', false);
if (PEAR::isError($id)) {
return $id;
}
http://cvs.php.net/viewcvs.cgi/pear/MDB2/MDB2/Driver/Reverse/mysqli.php?r1=1.33&r2=1.34&diff_format=u
Index: pear/MDB2/MDB2/Driver/Reverse/mysqli.php
diff -u pear/MDB2/MDB2/Driver/Reverse/mysqli.php:1.33 pear/MDB2/MDB2/Driver/Reverse/mysqli.php:1.34
--- pear/MDB2/MDB2/Driver/Reverse/mysqli.php:1.33 Thu Mar 2 08:10:27 2006
+++ pear/MDB2/MDB2/Driver/Reverse/mysqli.php Thu Mar 23 12:30:34 2006
@@ -42,7 +42,7 @@
// | Author: Lukas Smith <smith@pooteeweet.org> |
// +----------------------------------------------------------------------+
//
-// $Id: mysqli.php,v 1.33 2006/03/02 08:10:27 lsmith Exp $
+// $Id: mysqli.php,v 1.34 2006/03/23 12:30:34 lsmith Exp $
//
require_once 'MDB2/Driver/Reverse/Common.php';
@@ -350,7 +350,7 @@
* Probably received a table name.
* Create a result resource identifier.
*/
- $id = $db->_doQuery("SELECT * FROM $result LIMIT 0", false);
+ $id = $db->_doQuery('SELECT * FROM
'.$db->quoteIdentifier($result).' LIMIT 0', false);
if (PEAR::isError($id)) {
return $id;
}
http://cvs.php.net/viewcvs.cgi/pear/MDB2/MDB2/Driver/Reverse/oci8.php?r1=1.22&r2=1.23&diff_format=u
Index: pear/MDB2/MDB2/Driver/Reverse/oci8.php
diff -u pear/MDB2/MDB2/Driver/Reverse/oci8.php:1.22 pear/MDB2/MDB2/Driver/Reverse/oci8.php:1.23
--- pear/MDB2/MDB2/Driver/Reverse/oci8.php:1.22 Tue Mar 21 15:51:25 2006
+++ pear/MDB2/MDB2/Driver/Reverse/oci8.php Thu Mar 23 12:30:34 2006
@@ -42,7 +42,7 @@
// | Author: Lukas Smith <smith@pooteeweet.org> |
// +----------------------------------------------------------------------+
//
-// $Id: oci8.php,v 1.22 2006/03/21 15:51:25 lsmith Exp $
+// $Id: oci8.php,v 1.23 2006/03/23 12:30:34 lsmith Exp $
//
require_once 'MDB2/Driver/Reverse/Common.php';
@@ -354,11 +354,9 @@
* Probably received a table name.
* Create a result resource identifier.
*/
- $result = strtoupper($result);
- $query = 'SELECT column_name, data_type, data_length, '
- . 'nullable '
- . 'FROM user_tab_columns '
- . "WHERE table_name='$result' ORDER BY column_id";
+ $query = 'SELECT column_name, data_type, data_length, nullable';
+ $query.= ' FROM user_tab_columns';
+ $query.= ' WHERE table_name='.$db->quote(strtoupper($result),
'text').' ORDER BY column_id';
$stmt = $db->_doQuery($query, false);
if (PEAR::isError($stmt)) {
http://cvs.php.net/viewcvs.cgi/pear/MDB2/MDB2/Driver/Reverse/sqlite.php?r1=1.42&r2=1.43&diff_format=u
Index: pear/MDB2/MDB2/Driver/Reverse/sqlite.php
diff -u pear/MDB2/MDB2/Driver/Reverse/sqlite.php:1.42 pear/MDB2/MDB2/Driver/Reverse/sqlite.php:1.43
--- pear/MDB2/MDB2/Driver/Reverse/sqlite.php:1.42 Wed Mar 1 12:15:33 2006
+++ pear/MDB2/MDB2/Driver/Reverse/sqlite.php Thu Mar 23 12:30:34 2006
@@ -42,7 +42,7 @@
// | Author: Lukas Smith <smith@pooteeweet.org> |
// +----------------------------------------------------------------------+
//
-// $Id: sqlite.php,v 1.42 2006/03/01 12:15:33 lsmith Exp $
+// $Id: sqlite.php,v 1.43 2006/03/23 12:30:34 lsmith Exp $
//
require_once 'MDB2/Driver/Reverse/Common.php';
@@ -358,7 +358,7 @@
* Probably received a table name.
* Create a result resource identifier.
*/
- $id = $db->queryAll("PRAGMA table_info('$result');", null,
MDB2_FETCHMODE_ASSOC);
+ $id = $db->queryAll('PRAGMA table_info('.$db->quote($result,
'text').');', null, MDB2_FETCHMODE_ASSOC);
$got_string = true;
if ($db->options['portability'] & MDB2_PORTABILITY_FIX_CASE) {