0 as field name causes problems (bug #1042235).

This commit is contained in:
Michal Čihař
2004-10-19 13:55:00 +00:00
parent 34e3a84aa3
commit 82e4fb6cc3
3 changed files with 6 additions and 2 deletions

View File

@@ -13,6 +13,8 @@ $Source$
#1048826).
* main.php, queryframe.php: Handle correctly situation with no default
server (bug #1049107).
* tbl_create.php, libraries/common.lib.php: 0 as field name causes
problems (bug #1042235).
2004-10-17 Marc Delisle <lem9@users.sourceforge.net>
* lang/turkish update, thanks to boralioglu.

View File

@@ -1352,8 +1352,9 @@ if ($is_minimum_common == FALSE) {
*/
function PMA_backquote($a_name, $do_it = TRUE)
{
// '0' is also empty for php :-(
if ($do_it
&& !empty($a_name) && $a_name != '*') {
&& (!empty($a_name) || $a_name == '0') && $a_name != '*') {
if (is_array($a_name)) {
$result = array();

View File

@@ -55,7 +55,8 @@ if (isset($submit_num_fields)) {
} // end for
// Builds the fields creation statements
for ($i = 0; $i < $field_cnt; $i++) {
if (empty($field_name[$i])) {
// '0' is also empty for php :-(
if (empty($field_name[$i]) && $field_name[$i] != '0') {
continue;
}
$query = PMA_backquote($field_name[$i]) . ' ' . $field_type[$i];