bug 926986, code optimizations

This commit is contained in:
Marcel Tschopp
2004-04-08 14:19:31 +00:00
parent cd22812a2e
commit a1417f09f0
3 changed files with 41 additions and 26 deletions

View File

@@ -12,6 +12,8 @@ $Source$
phpMyAdmin should now be fully compatible with the new mysqli phpMyAdmin should now be fully compatible with the new mysqli
extension. All extension specific functions are wrapped now. extension. All extension specific functions are wrapped now.
* libraries/dbi/mysqli.dbi.lib.php: code optimizations * libraries/dbi/mysqli.dbi.lib.php: code optimizations
* tbl_replace.php: bug 926986, "multi-edit: updates completely ignored",
thanks to Wandering Zombie (wanderingzombie).
2004-04-07 Marcel Tschopp <marcel.tschopp@gmx.net> 2004-04-07 Marcel Tschopp <marcel.tschopp@gmx.net>
* multi_submits.inc.php, lang/german: bug 930714, wrong spelling and * multi_submits.inc.php, lang/german: bug 930714, wrong spelling and

View File

@@ -228,36 +228,49 @@ function PMA_DBI_affected_rows($link) {
function PMA_DBI_get_fields_meta($result) { function PMA_DBI_get_fields_meta($result) {
// Build an associative array for a type look up // Build an associative array for a type look up
$typeAr[MYSQLI_TYPE_DECIMAL] = 'real'; $typeAr = Array();
$typeAr[MYSQLI_TYPE_TINY] = 'int'; $typeAr[MYSQLI_TYPE_DECIMAL] = 'real';
$typeAr[MYSQLI_TYPE_SHORT] = 'int'; $typeAr[MYSQLI_TYPE_TINY] = 'int';
$typeAr[MYSQLI_TYPE_LONG] = 'int'; $typeAr[MYSQLI_TYPE_SHORT] = 'int';
$typeAr[MYSQLI_TYPE_FLOAT] = 'real'; $typeAr[MYSQLI_TYPE_LONG] = 'int';
$typeAr[MYSQLI_TYPE_DOUBLE] = 'real'; $typeAr[MYSQLI_TYPE_FLOAT] = 'real';
$typeAr[MYSQLI_TYPE_NULL] = 'null'; $typeAr[MYSQLI_TYPE_DOUBLE] = 'real';
$typeAr[MYSQLI_TYPE_TIMESTAMP] = 'timestamp'; $typeAr[MYSQLI_TYPE_NULL] = 'null';
$typeAr[MYSQLI_TYPE_LONGLONG] = 'int'; $typeAr[MYSQLI_TYPE_TIMESTAMP] = 'timestamp';
$typeAr[MYSQLI_TYPE_INT24] = 'int'; $typeAr[MYSQLI_TYPE_LONGLONG] = 'int';
$typeAr[MYSQLI_TYPE_DATE] = 'date'; $typeAr[MYSQLI_TYPE_INT24] = 'int';
$typeAr[MYSQLI_TYPE_TIME] = 'time'; $typeAr[MYSQLI_TYPE_DATE] = 'date';
$typeAr[MYSQLI_TYPE_DATETIME] = 'datetime'; $typeAr[MYSQLI_TYPE_TIME] = 'time';
$typeAr[MYSQLI_TYPE_YEAR] = 'year'; $typeAr[MYSQLI_TYPE_DATETIME] = 'datetime';
$typeAr[MYSQLI_TYPE_NEWDATE] = 'date'; $typeAr[MYSQLI_TYPE_YEAR] = 'year';
$typeAr[MYSQLI_TYPE_ENUM] = 'unknown'; $typeAr[MYSQLI_TYPE_NEWDATE] = 'date';
$typeAr[MYSQLI_TYPE_SET] = 'unknown'; $typeAr[MYSQLI_TYPE_ENUM] = 'unknown';
$typeAr[MYSQLI_TYPE_TINY_BLOB] = 'blob'; $typeAr[MYSQLI_TYPE_SET] = 'unknown';
$typeAr[MYSQLI_TYPE_TINY_BLOB] = 'blob';
$typeAr[MYSQLI_TYPE_MEDIUM_BLOB] = 'blob'; $typeAr[MYSQLI_TYPE_MEDIUM_BLOB] = 'blob';
$typeAr[MYSQLI_TYPE_LONG_BLOB] = 'blob'; $typeAr[MYSQLI_TYPE_LONG_BLOB] = 'blob';
$typeAr[MYSQLI_TYPE_BLOB] = 'blob'; $typeAr[MYSQLI_TYPE_BLOB] = 'blob';
$typeAr[MYSQLI_TYPE_VAR_STRING] = 'string'; $typeAr[MYSQLI_TYPE_VAR_STRING] = 'string';
$typeAr[MYSQLI_TYPE_STRING] = 'string'; $typeAr[MYSQLI_TYPE_STRING] = 'string';
$typeAr[MYSQLI_TYPE_CHAR] = 'string'; $typeAr[MYSQLI_TYPE_CHAR] = 'string';
$typeAr[MYSQLI_TYPE_GEOMETRY] = 'unknown'; $typeAr[MYSQLI_TYPE_GEOMETRY] = 'unknown';
$fields = mysqli_fetch_fields($result); $fields = mysqli_fetch_fields($result);
foreach($fields as $k => $field) { foreach($fields as $k => $field) {
$fields[$k]->type = $typeAr[$field->type]; $fields[$k]->type = $typeAr[$fields[$k]->type];
$fields[$k]->flags = PMA_DBI_field_flags($result, $k); $fields[$k]->flags = PMA_DBI_field_flags($result, $k);
// Enhance the field objects for mysql-extension compatibilty
$flags = explode(' ', $fields[$k]->flags);
array_unshift($flags, 'dummy');
$fields[$k]->multiple_key = (int)(array_search('multiple_key', $flags, true) > 0);
$fields[$k]->primary_key = (int)(array_search('primary_key', $flags, true) > 0);
$fields[$k]->unique_key = (int)(array_search('unique_key', $flags, true) > 0);
$fields[$k]->not_null = (int)(array_search('not_null', $flags, true) > 0);
$fields[$k]->unsigned = (int)(array_search('unsigned', $flags, true) > 0);
$fields[$k]->zerofill = (int)(array_search('zerofill', $flags, true) > 0);
$fields[$k]->numeric = (int)(array_search('num', $flags, true) > 0);
$fields[$k]->blob = (int)(array_search('blob', $flags, true) > 0);
} }
return $fields; return $fields;
} }

View File

@@ -143,7 +143,7 @@ if (isset($primary_key) && ($submit_type != $strInsertAsNewRow)) {
} }
} }
if (empty($valuelist)) { if (empty($valuelist) && empty($query)) {
// No change -> move back to the calling script // No change -> move back to the calling script
$message = $strNoModification; $message = $strNoModification;
if ($is_gotofile) { if ($is_gotofile) {