bug #1910621 [display] part 1: do not display a TEXT utf8_bin as BLOB (fixed for mysqli extension only)

This commit is contained in:
Marc Delisle
2008-04-28 16:47:31 +00:00
parent 6a17192775
commit 582a9e179d
2 changed files with 8 additions and 2 deletions

View File

@@ -8,6 +8,8 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
2.11.7.0 (not yet released) 2.11.7.0 (not yet released)
- bug #1908719 [interface] New field cannot be auto-increment and primary key - bug #1908719 [interface] New field cannot be auto-increment and primary key
- [dbi] Incorrect interpretation for some mysqli field flags - [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) 2.11.6.0 (not yet released)
- bug #1903724 [interface] Displaying of very large queries in error message - bug #1903724 [interface] Displaying of very large queries in error message

View File

@@ -643,7 +643,6 @@ function PMA_DBI_field_name($result, $i)
* @uses MYSQLI_TIMESTAMP_FLAG * @uses MYSQLI_TIMESTAMP_FLAG
* @uses MYSQLI_AUTO_INCREMENT_FLAG * @uses MYSQLI_AUTO_INCREMENT_FLAG
* @uses MYSQLI_TYPE_ENUM * @uses MYSQLI_TYPE_ENUM
* @uses MYSQLI_BINARY_FLAG
* @uses MYSQLI_ZEROFILL_FLAG * @uses MYSQLI_ZEROFILL_FLAG
* @uses MYSQLI_UNSIGNED_FLAG * @uses MYSQLI_UNSIGNED_FLAG
* @uses MYSQLI_BLOB_FLAG * @uses MYSQLI_BLOB_FLAG
@@ -664,6 +663,7 @@ function PMA_DBI_field_flags($result, $i)
define('MYSQLI_ENUM_FLAG', 256); // see MySQL source include/mysql_com.h define('MYSQLI_ENUM_FLAG', 256); // see MySQL source include/mysql_com.h
} }
$f = mysqli_fetch_field_direct($result, $i); $f = mysqli_fetch_field_direct($result, $i);
$charsetnr = $f->charsetnr;
$f = $f->flags; $f = $f->flags;
$flags = ''; $flags = '';
if ($f & MYSQLI_UNIQUE_KEY_FLAG) { $flags .= 'unique ';} if ($f & MYSQLI_UNIQUE_KEY_FLAG) { $flags .= 'unique ';}
@@ -673,7 +673,11 @@ function PMA_DBI_field_flags($result, $i)
if ($f & MYSQLI_TIMESTAMP_FLAG) { $flags .= 'timestamp ';} if ($f & MYSQLI_TIMESTAMP_FLAG) { $flags .= 'timestamp ';}
if ($f & MYSQLI_AUTO_INCREMENT_FLAG) { $flags .= 'auto_increment ';} if ($f & MYSQLI_AUTO_INCREMENT_FLAG) { $flags .= 'auto_increment ';}
if ($f & MYSQLI_ENUM_FLAG) { $flags .= 'enum ';} 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_ZEROFILL_FLAG) { $flags .= 'zerofill ';}
if ($f & MYSQLI_UNSIGNED_FLAG) { $flags .= 'unsigned ';} if ($f & MYSQLI_UNSIGNED_FLAG) { $flags .= 'unsigned ';}
if ($f & MYSQLI_BLOB_FLAG) { $flags .= 'blob ';} if ($f & MYSQLI_BLOB_FLAG) { $flags .= 'blob ';}