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
extension. All extension specific functions are wrapped now.
* 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>
* multi_submits.inc.php, lang/german: bug 930714, wrong spelling and

View File

@@ -228,6 +228,7 @@ function PMA_DBI_affected_rows($link) {
function PMA_DBI_get_fields_meta($result) {
// Build an associative array for a type look up
$typeAr = Array();
$typeAr[MYSQLI_TYPE_DECIMAL] = 'real';
$typeAr[MYSQLI_TYPE_TINY] = 'int';
$typeAr[MYSQLI_TYPE_SHORT] = 'int';
@@ -256,8 +257,20 @@ function PMA_DBI_get_fields_meta($result) {
$fields = mysqli_fetch_fields($result);
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);
// 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;
}

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
$message = $strNoModification;
if ($is_gotofile) {