diff --git a/ChangeLog b/ChangeLog index 7cfa36566f..e80ad9d321 100644 --- a/ChangeLog +++ b/ChangeLog @@ -20,7 +20,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA thanks to Tony Marston - tonymarston - bug #1918531 [compatibility] Navigation isn't w3.org valid thanks to Michael Keck - mkkeck -- bug #1926357 [data] BIT defaults displayed incorrectly (todo: export?) +- bug #1926357 [data] BIT defaults displayed incorrectly - patch #1930057 [auth] colon in password prevents HTTP login on CGI/IIS, thanks to Jürgen Wind - windkiel - patch #1929553 [lang] Don't output BOM character in Swedish language file, diff --git a/libraries/dbi/mysqli.dbi.lib.php b/libraries/dbi/mysqli.dbi.lib.php index 3270ec666b..fffb0d037b 100644 --- a/libraries/dbi/mysqli.dbi.lib.php +++ b/libraries/dbi/mysqli.dbi.lib.php @@ -574,6 +574,7 @@ function PMA_DBI_get_fields_meta($result) // https://sf.net/tracker/?func=detail&aid=1532111&group_id=23067&atid=377408 //$typeAr[MYSQLI_TYPE_CHAR] = 'string'; $typeAr[MYSQLI_TYPE_GEOMETRY] = 'unknown'; + $typeAr[MYSQLI_TYPE_BIT] = 'bit'; $fields = mysqli_fetch_fields($result); diff --git a/libraries/export/sql.php b/libraries/export/sql.php index f4564dff65..9e7d00b8c7 100644 --- a/libraries/export/sql.php +++ b/libraries/export/sql.php @@ -480,6 +480,10 @@ function PMA_getTableDef($db, $table, $crlf, $error_url, $show_dates = false) // results below. Nonetheless, we got 2 user reports about this // (see bug 1562533) so I remove the unbuffered mode. //$result = PMA_DBI_query('SHOW CREATE TABLE ' . PMA_backquote($db) . '.' . PMA_backquote($table), null, PMA_DBI_QUERY_UNBUFFERED); + // + // Note: SHOW CREATE TABLE, at least in MySQL 5.1.23, does not + // produce a displayable result for the default value of a BIT + // field, nor does the mysqldump command. See MySQL bug 35796 $result = PMA_DBI_query('SHOW CREATE TABLE ' . PMA_backquote($db) . '.' . PMA_backquote($table)); if ($result != FALSE && ($row = PMA_DBI_fetch_row($result))) { $create_query = $row[1]; @@ -907,6 +911,9 @@ function PMA_exportData($db, $table, $crlf, $error_url, $sql_query) } else { $values[] = '0x' . bin2hex($row[$j]); } + // detection of 'bit' works only on mysqli extension + } elseif ($fields_meta[$j]->type == 'bit') { + $values[] = "b'" . PMA_sqlAddslashes(PMA_printable_bit_value($row[$j], $fields_meta[$j]->length)) . "'"; // something else -> treat as a string } else { $values[] = '\'' . str_replace($search, $replace, PMA_sqlAddslashes($row[$j])) . '\'';