should backquote the field named comment
This commit is contained in:
@@ -7,6 +7,9 @@ $Source$
|
||||
|
||||
2003-02-06 Marc Delisle <lem9@users.sourceforge.net>
|
||||
* libraries/sqlparser.lib.php3: PHP3 parse error
|
||||
* Documentation.html, db_details_importdocsql.php3, tbl_relation.php3,
|
||||
libraries/relation.lib.php3: bug 681298, we should always backquote
|
||||
a restricted word like "comment" when used as an identifier
|
||||
|
||||
2003-02-05 Alexander M. Turek <rabus@users.sourceforge.net>
|
||||
* db_details.php3, tbl_query_box.php3: Disabled the autoselect feature of
|
||||
|
@@ -769,7 +769,7 @@ $cfg['PmaAbsoluteUri'] = (!empty($_SERVER['HTTPS']) ? 'https' : 'http') . '://'
|
||||
db_name varchar(64) NOT NULL default '',<br />
|
||||
table_name varchar(64) NOT NULL default '',<br />
|
||||
column_name varchar(64) NOT NULL default '',<br />
|
||||
comment varchar(255) NOT NULL default '',<br />
|
||||
`comment` varchar(255) NOT NULL default '',<br />
|
||||
PRIMARY KEY (id),<br />
|
||||
UNIQUE KEY db_name (db_name, table_name, column_name)<br />
|
||||
) TYPE=MyISAM COMMENT='Comments for Columns';<br />
|
||||
|
@@ -49,7 +49,7 @@ if (isset($do) && $do == 'import') {
|
||||
$inf = explode('|',$line);
|
||||
if (!empty($inf[1]) && strlen(trim($inf[1])) > 0) {
|
||||
$qry = 'INSERT INTO ' . PMA_backquote($cfgRelation['column_comments'])
|
||||
. ' (db_name, table_name, column_name, comment) '
|
||||
. ' (db_name, table_name, column_name, ' . PMA_backquote('comment') . ') '
|
||||
. ' VALUES('
|
||||
. '\'' . PMA_sqlAddslashes($db) . '\','
|
||||
. '\'' . PMA_sqlAddslashes(trim($tab)) . '\','
|
||||
|
@@ -297,7 +297,7 @@ if (!defined('PMA_RELATION_LIB_INCLUDED')){
|
||||
function PMA_getComments($db, $table) {
|
||||
global $cfgRelation;
|
||||
|
||||
$com_qry = 'SELECT column_name, comment FROM ' . PMA_backquote($cfgRelation['column_comments'])
|
||||
$com_qry = 'SELECT column_name, ' . PMA_backquote('comment') . ' FROM ' . PMA_backquote($cfgRelation['column_comments'])
|
||||
. ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''
|
||||
. ' AND table_name = \'' . PMA_sqlAddslashes($table) . '\'';
|
||||
$com_rs = PMA_query_as_cu($com_qry);
|
||||
|
@@ -105,7 +105,7 @@ if ($cfgRelation['displaywork']
|
||||
if ($cfgRelation['commwork']
|
||||
&& isset($submit_comm) && $submit_comm == 'true') {
|
||||
while (list($key, $value) = each($comment)) {
|
||||
$test_qry = 'SELECT comment FROM ' . PMA_backquote($cfgRelation['column_comments'])
|
||||
$test_qry = 'SELECT ' . PMA_backquote('comment') . ' FROM ' . PMA_backquote($cfgRelation['column_comments'])
|
||||
. ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''
|
||||
. ' AND table_name = \'' . PMA_sqlAddslashes($table) . '\''
|
||||
. ' AND column_name = \'' . PMA_handleSlashes($key) . '\'';
|
||||
@@ -113,7 +113,7 @@ if ($cfgRelation['commwork']
|
||||
if ($test_rs && mysql_num_rows($test_rs) > 0) {
|
||||
if (strlen($value) > 0) {
|
||||
$upd_query = 'UPDATE ' . PMA_backquote($cfgRelation['column_comments'])
|
||||
. ' SET comment = \'' . PMA_handleSlashes($value) . '\''
|
||||
. ' SET ' . PMA_backquote('comment') . ' = \'' . PMA_handleSlashes($value) . '\''
|
||||
. ' WHERE db_name = \'' . PMA_sqlAddslashes($db) . '\''
|
||||
. ' AND table_name = \'' . PMA_sqlAddslashes($table) . '\''
|
||||
. ' AND column_name = \'' . PMA_handleSlashes($key) . '\'';
|
||||
@@ -125,7 +125,7 @@ if ($cfgRelation['commwork']
|
||||
}
|
||||
} else if (strlen($value) > 0) {
|
||||
$upd_query = 'INSERT INTO ' . PMA_backquote($cfgRelation['column_comments'])
|
||||
. ' (db_name, table_name, column_name, comment) '
|
||||
. ' (db_name, table_name, column_name, ' . PMA_backquote('comment') . ') '
|
||||
. ' VALUES('
|
||||
. '\'' . PMA_sqlAddslashes($db) . '\','
|
||||
. '\'' . PMA_sqlAddslashes($table) . '\','
|
||||
|
Reference in New Issue
Block a user