From c0f4d281e7dff96bbc0a1cc9666c37d21b5229dc Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Fri, 3 Aug 2001 02:28:01 +0000 Subject: [PATCH] bug 445722 --- ChangeLog | 2 ++ tbl_change.php3 | 13 +++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index d96719d09..47a954cf5 100755 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,8 @@ $Source$ * tbl_qbe.php3: workaround a PHP3 problem * tbl_change.php3: bug 446830 (enums), adapted patch from Ignacio Vazquez-Abrams (ivazquezabrams) + * tbl_change.php3: bug 445722 when one of the enums is a datatype + enum('text','audio','image','video','data','application','other') 2001-08-02 Benjamin Gandon * Documentation.html: added a FAQ entry about the buggy php diff --git a/tbl_change.php3 b/tbl_change.php3 index a1b75a905..52f0928a9 100755 --- a/tbl_change.php3 +++ b/tbl_change.php3 @@ -80,7 +80,9 @@ for ($i = 0; $i < mysql_num_rows($table_def); $i++) { echo "\n"; // The type column - switch (ereg_replace('\\(.*', '', $row_table_def['Type'])) { + $row_table_def['True_Type']=ereg_replace('\\(.*','',$row_table_def['Type']); + //switch (ereg_replace('\\(.*', '', $row_table_def['Type'])) { + switch ($row_table_def['True_Type']) { case 'set': $type = 'set'; $type_nowrap = ''; @@ -121,7 +123,8 @@ for ($i = 0; $i < mysql_num_rows($table_def); $i++) { // is binary //if ((strstr($row_table_def['Type'], 'blob') || strstr($row_table_def['Type'], 'binary')) - if (strstr($row_table_def['Type'], 'blob') + //if (strstr($row_table_def['Type'], 'blob') + if (strstr($row_table_def['True_Type'], 'blob') && !empty($data) && $cfgProtectBlob==TRUE) { echo ' ' . $strBinary . '' . "\n"; @@ -156,7 +159,8 @@ for ($i = 0; $i < mysql_num_rows($table_def); $i++) { echo "\n"; // The value column (depends on type) - if (strstr($row_table_def['Type'], 'text')) { + //if (strstr($row_table_def['Type'], 'text')) { + if (strstr($row_table_def['True_Type'], 'text')) { ?> @@ -167,7 +171,8 @@ for ($i = 0; $i < mysql_num_rows($table_def); $i++) { echo ' ' . $strTextAreaLength . '' . "\n"; } } - else if (strstr($row_table_def['Type'], 'enum')) { + //else if (strstr($row_table_def['Type'], 'enum')) { + else if (strstr($row_table_def['True_Type'], 'enum')) { $set = str_replace('enum(', '', $row_table_def['Type']); $set = ereg_replace('\\)$', '', $set); $set = explode('\',\'', substr($set, 1, -1));