From ea64f8f731928cfed87f7149a39dc797af8ce08a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 14 Dec 2011 09:49:35 +0100 Subject: [PATCH 1/7] Whitespace cleanup --- libraries/dbi/mysql.dbi.lib.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/dbi/mysql.dbi.lib.php b/libraries/dbi/mysql.dbi.lib.php index c4f22fb28a..0a7c86183c 100644 --- a/libraries/dbi/mysql.dbi.lib.php +++ b/libraries/dbi/mysql.dbi.lib.php @@ -175,8 +175,8 @@ function PMA_DBI_try_query($query, $link = null, $options = 0, $cache_affected_r $r = mysql_query($query, $link); } - if ($cache_affected_rows) { - $GLOBALS['cached_affected_rows'] = PMA_DBI_affected_rows($link, $get_from_cache = false); + if ($cache_affected_rows) { + $GLOBALS['cached_affected_rows'] = PMA_DBI_affected_rows($link, $get_from_cache = false); } if ($GLOBALS['cfg']['DBG']['sql']) { @@ -406,7 +406,7 @@ function PMA_DBI_insert_id($link = null) * @uses $GLOBALS['userlink'] * @uses mysql_affected_rows() * @param object mysql $link the mysql object - * @param boolean $get_from_cache + * @param boolean $get_from_cache * @return string integer */ function PMA_DBI_affected_rows($link = null, $get_from_cache = true) From a074b4c6e28b044670d21dec791ad0f909eba251 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 14 Dec 2011 09:49:49 +0100 Subject: [PATCH 2/7] Create fake flags field The content is empty for now, but at least the code will not emit warnings on every access to it (which is quite often). The proper value calculation should be added later. --- libraries/dbi/mysql.dbi.lib.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libraries/dbi/mysql.dbi.lib.php b/libraries/dbi/mysql.dbi.lib.php index 0a7c86183c..96b69338df 100644 --- a/libraries/dbi/mysql.dbi.lib.php +++ b/libraries/dbi/mysql.dbi.lib.php @@ -434,7 +434,9 @@ function PMA_DBI_get_fields_meta($result) $fields = array(); $num_fields = mysql_num_fields($result); for ($i = 0; $i < $num_fields; $i++) { - $fields[] = mysql_fetch_field($result, $i); + $field = mysql_fetch_field($result, $i); + $field->flags = ''; + $fields[] = $field; } return $fields; } From 396e5716f89d291f366266e639c26e2ed8391dd2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 14 Dec 2011 09:51:18 +0100 Subject: [PATCH 3/7] Use mysqli in example configuration The mysql extension does not support some features we use and I think it is safe to assume nearly everybody has mysqli. --- config.sample.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/config.sample.inc.php b/config.sample.inc.php index 0ea16d5f76..1a22fc3c80 100644 --- a/config.sample.inc.php +++ b/config.sample.inc.php @@ -31,8 +31,8 @@ $cfg['Servers'][$i]['auth_type'] = 'cookie'; $cfg['Servers'][$i]['host'] = 'localhost'; $cfg['Servers'][$i]['connect_type'] = 'tcp'; $cfg['Servers'][$i]['compress'] = false; -/* Select mysqli if your server has it */ -$cfg['Servers'][$i]['extension'] = 'mysql'; +/* Select mysql if your server does not have mysqli */ +$cfg['Servers'][$i]['extension'] = 'mysqli'; $cfg['Servers'][$i]['AllowNoPassword'] = false; /* From cec8f1b0941595ea7673fa990b3291fd564220c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 14 Dec 2011 09:56:02 +0100 Subject: [PATCH 4/7] Add actually some sane value to field flags --- libraries/dbi/mysql.dbi.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/dbi/mysql.dbi.lib.php b/libraries/dbi/mysql.dbi.lib.php index 96b69338df..408f6a3b33 100644 --- a/libraries/dbi/mysql.dbi.lib.php +++ b/libraries/dbi/mysql.dbi.lib.php @@ -435,7 +435,7 @@ function PMA_DBI_get_fields_meta($result) $num_fields = mysql_num_fields($result); for ($i = 0; $i < $num_fields; $i++) { $field = mysql_fetch_field($result, $i); - $field->flags = ''; + $field->flags = mysql_field_flags($result, $i); $fields[] = $field; } return $fields; From 91241f71d329d6692c9761ded0b19d6f75730fec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 14 Dec 2011 09:58:47 +0100 Subject: [PATCH 5/7] Fill orgtable and orgname attributes --- libraries/dbi/mysql.dbi.lib.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libraries/dbi/mysql.dbi.lib.php b/libraries/dbi/mysql.dbi.lib.php index 408f6a3b33..87be162851 100644 --- a/libraries/dbi/mysql.dbi.lib.php +++ b/libraries/dbi/mysql.dbi.lib.php @@ -436,6 +436,8 @@ function PMA_DBI_get_fields_meta($result) for ($i = 0; $i < $num_fields; $i++) { $field = mysql_fetch_field($result, $i); $field->flags = mysql_field_flags($result, $i); + $field->orgtable = mysql_field_table($result, $i); + $field->orgname = mysql_field_name($result, $i); $fields[] = $field; } return $fields; From da62d86238949a5dbb42f64dcdfed81a4fc5b36a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 14 Dec 2011 10:00:01 +0100 Subject: [PATCH 6/7] These are done and we do not seem to use decimals --- libraries/dbi/mysql.dbi.lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/dbi/mysql.dbi.lib.php b/libraries/dbi/mysql.dbi.lib.php index 87be162851..f9595392d7 100644 --- a/libraries/dbi/mysql.dbi.lib.php +++ b/libraries/dbi/mysql.dbi.lib.php @@ -427,7 +427,7 @@ function PMA_DBI_affected_rows($link = null, $get_from_cache = true) } /** - * @todo add missing keys like in from mysqli_query (orgname, orgtable, flags, decimals) + * @todo add missing keys like in from mysqli_query (decimals) */ function PMA_DBI_get_fields_meta($result) { From 458e015ec2bd5f887b3240faef0ca36f8474d3bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 14 Dec 2011 10:03:20 +0100 Subject: [PATCH 7/7] Changelog entry --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index b2cdf5d51e..5eb0138c5f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,7 @@ phpMyAdmin - ChangeLog - bug #3452506 [edit] Unable to move tables with triggers - bug #3449659 [navi] Fast filter broken with table tree - bug #3448485 [GUI] Firefox favicon frameset regression +- [core] Better compatibility with mysql extension 3.4.8.0 (2011-12-01) - bug #3425230 [interface] enum data split at space char (more space to edit)