improved the fix against bug #489440
This commit is contained in:
@@ -120,7 +120,13 @@ $fields_names = array();
|
|||||||
$fields_types = array();
|
$fields_types = array();
|
||||||
while ($row = mysql_fetch_array($fields_rs)) {
|
while ($row = mysql_fetch_array($fields_rs)) {
|
||||||
$fields_names[] = $row['Field'];
|
$fields_names[] = $row['Field'];
|
||||||
|
// loic1: set or enum types: slashes single quotes inside options
|
||||||
|
if (eregi('^(set|enum)\((.+)\)$', $row['Type'], $tmp)) {
|
||||||
|
$tmp[2] = substr(ereg_replace('([^,])\'\'', '\\1\\\'', ',' . $tmp[2]), 1);
|
||||||
|
$fields_types[] = $tmp[1] . '(' . str_replace(',', ', ', $tmp[2]) . ')';
|
||||||
|
} else {
|
||||||
$fields_types[] = $row['Type'];
|
$fields_types[] = $row['Type'];
|
||||||
|
}
|
||||||
} // end while
|
} // end while
|
||||||
|
|
||||||
if ($fields_rs) {
|
if ($fields_rs) {
|
||||||
|
@@ -168,8 +168,7 @@ while (list($key, $table) = each($the_tables)) {
|
|||||||
// reformat mysql query output - staybyte - 9. June 2001
|
// reformat mysql query output - staybyte - 9. June 2001
|
||||||
// loic1: set or enum types: slashes single quotes inside options
|
// loic1: set or enum types: slashes single quotes inside options
|
||||||
if (eregi('^(set|enum)\((.+)\)$', $type, $tmp)) {
|
if (eregi('^(set|enum)\((.+)\)$', $type, $tmp)) {
|
||||||
$tmp[2] = ereg_replace('([^,])\'([^,])', '\\1\\\'\\2', ',' . $tmp[2] . ',');
|
$tmp[2] = substr(ereg_replace('([^,])\'\'', '\\1\\\'', ',' . $tmp[2]), 1);
|
||||||
$tmp[2] = substr($tmp[2], 1, -1);
|
|
||||||
$type = $tmp[1] . '(' . str_replace(',', ', ', $tmp[2]) . ')';
|
$type = $tmp[1] . '(' . str_replace(',', ', ', $tmp[2]) . ')';
|
||||||
$type_nowrap = '';
|
$type_nowrap = '';
|
||||||
} else {
|
} else {
|
||||||
|
@@ -90,8 +90,7 @@ for ($i = 0 ; $i < $num_fields; $i++) {
|
|||||||
// set or enum types: slashes single quotes inside options
|
// set or enum types: slashes single quotes inside options
|
||||||
if (eregi('^(set|enum)\((.+)\)$', $type, $tmp)) {
|
if (eregi('^(set|enum)\((.+)\)$', $type, $tmp)) {
|
||||||
$type = $tmp[1];
|
$type = $tmp[1];
|
||||||
$length = ereg_replace('([^,])\'([^,])', '\\1\\\'\\2', ',' . $tmp[2] . ',');
|
$length = substr(ereg_replace('([^,])\'\'', '\\1\\\'', ',' . $tmp[2]), 1);
|
||||||
$length = substr($length, 1, -1);
|
|
||||||
} else {
|
} else {
|
||||||
$length = $type;
|
$length = $type;
|
||||||
$type = chop(eregi_replace('\\(.*\\)', '', $type));
|
$type = chop(eregi_replace('\\(.*\\)', '', $type));
|
||||||
|
@@ -255,8 +255,7 @@ while ($row = mysql_fetch_array($fields_rs)) {
|
|||||||
// reformat mysql query output - staybyte - 9. June 2001
|
// reformat mysql query output - staybyte - 9. June 2001
|
||||||
// loic1: set or enum types: slashes single quotes inside options
|
// loic1: set or enum types: slashes single quotes inside options
|
||||||
if (eregi('^(set|enum)\((.+)\)$', $type, $tmp)) {
|
if (eregi('^(set|enum)\((.+)\)$', $type, $tmp)) {
|
||||||
$tmp[2] = ereg_replace('([^,])\'([^,])', '\\1\\\'\\2', ',' . $tmp[2] . ',');
|
$tmp[2] = substr(ereg_replace('([^,])\'\'', '\\1\\\'', ',' . $tmp[2]), 1);
|
||||||
$tmp[2] = substr($tmp[2], 1, -1);
|
|
||||||
$type = $tmp[1] . '(' . str_replace(',', ', ', $tmp[2]) . ')';
|
$type = $tmp[1] . '(' . str_replace(',', ', ', $tmp[2]) . ')';
|
||||||
$type_nowrap = '';
|
$type_nowrap = '';
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user