From c8cfea6fd9a2aedc75b80515e8a2bdf0ddbf26b0 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Mon, 28 Apr 2008 16:47:31 +0000 Subject: [PATCH] bug #1910621 [display] part 1: do not display a TEXT utf8_bin as BLOB (fixed for mysqli extension only) --- ChangeLog | 2 ++ libraries/dbi/mysqli.dbi.lib.php | 8 ++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 94ee546ee..61890086d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -54,6 +54,8 @@ danbarry 2.11.7.0 (not yet released) - bug #1908719 [interface] New field cannot be auto-increment and primary key - [dbi] Incorrect interpretation for some mysqli field flags +- bug #1910621 [display] part 1: do not display a TEXT utf8_bin as BLOB + (fixed for mysqli extension only) 2.11.6.0 (not yet released) - bug #1903724 [interface] Displaying of very large queries in error message diff --git a/libraries/dbi/mysqli.dbi.lib.php b/libraries/dbi/mysqli.dbi.lib.php index bae0dc8ee..551c119cc 100644 --- a/libraries/dbi/mysqli.dbi.lib.php +++ b/libraries/dbi/mysqli.dbi.lib.php @@ -564,7 +564,6 @@ function PMA_DBI_field_name($result, $i) * @uses MYSQLI_TIMESTAMP_FLAG * @uses MYSQLI_AUTO_INCREMENT_FLAG * @uses MYSQLI_TYPE_ENUM - * @uses MYSQLI_BINARY_FLAG * @uses MYSQLI_ZEROFILL_FLAG * @uses MYSQLI_UNSIGNED_FLAG * @uses MYSQLI_BLOB_FLAG @@ -584,6 +583,7 @@ function PMA_DBI_field_flags($result, $i) define('MYSQLI_ENUM_FLAG', 256); // see MySQL source include/mysql_com.h } $f = mysqli_fetch_field_direct($result, $i); + $charsetnr = $f->charsetnr; $f = $f->flags; $flags = ''; if ($f & MYSQLI_UNIQUE_KEY_FLAG) { $flags .= 'unique ';} @@ -593,7 +593,11 @@ function PMA_DBI_field_flags($result, $i) if ($f & MYSQLI_TIMESTAMP_FLAG) { $flags .= 'timestamp ';} if ($f & MYSQLI_AUTO_INCREMENT_FLAG) { $flags .= 'auto_increment ';} if ($f & MYSQLI_ENUM_FLAG) { $flags .= 'enum ';} - if ($f & MYSQLI_BINARY_FLAG) { $flags .= 'binary ';} + // See http://dev.mysql.com/doc/refman/6.0/en/c-api-datatypes.html: + // to determine the data type, we should not use MYSQLI_BINARY_FLAG + // the binary flag but instead the charsetnr member of the MYSQL_FIELD + // structure. Unfortunately there is no equivalent in the mysql extension. + if (63 == $charsetnr) { $flags .= 'binary ';} if ($f & MYSQLI_ZEROFILL_FLAG) { $flags .= 'zerofill ';} if ($f & MYSQLI_UNSIGNED_FLAG) { $flags .= 'unsigned ';} if ($f & MYSQLI_BLOB_FLAG) { $flags .= 'blob ';}