neojjang / wwwsqldesigner

Automatically exported from code.google.com/p/wwwsqldesigner
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Reverse-engineering with default-value and (var)binary-columns might not work #98

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. When reverse-engineering a database schema from information_schema
(mysql) and if there's a table that has default-value for binary-column,
the returned XML might be corrupt... 
Example: mediawiki database schema: Table user_newtalk has such a
default-value that will lead to an invalid XML.

What is the expected output? What do you see instead?
No reverse engineered tables will appear on the workspace... there's no
error-feedback to the user or whatsoever.

What version of the product are you using? On what operating system?
wwwsqldesigner-2.4 / MySQL 5.1

Please provide any additional information below.

I already fixed it locally in "backend/php-mysql/index.php". Not really
sure if it's really correct, but at least a user will get a result ;)

This is what I did:
 45                         $q = "SELECT * FROM COLUMNS WHERE TABLE_NAME =
'".$table."' AND TABLE_SCHEMA = '".$db."'";
 46                         $result2 = mysql_query($q);
 47                         while ($row = mysql_fetch_array($result2)) {
 48                                 $name  = $row["COLUMN_NAME"];
 49                                 $type  = $row["COLUMN_TYPE"];
 50                                 $comment =
(isset($row["COLUMN_COMMENT"]) ? $row["COLUMN_COMMENT"] : "");
 51                                 $null = ($row["IS_NULLABLE"] == "YES" ?
"0" : "1");
 52                                 if
(preg_match("/binary/i",$row["COLUMN_TYPE"])) {    // <<-- NEW!
 53                                   $def =
bin2hex($row["COLUMN_DEFAULT"]);  // <<-- NEW!
 54                                 } else {
 55                                   $def = $row["COLUMN_DEFAULT"];
 56                                 }

cheers.

Original issue reported on code.google.com by Marcel...@gmail.com on 27 May 2010 at 8:16

GoogleCodeExporter commented 9 years ago
This certainly needs some attention.

Original comment by ondrej.zara on 27 May 2010 at 9:17

GoogleCodeExporter commented 9 years ago

Original comment by ondrej.zara on 31 Aug 2010 at 10:42

GoogleCodeExporter commented 9 years ago
I just downloaded and installed version 2.5 ... this bug still exists in that 
version ;//

Original comment by Marcel...@gmail.com on 4 Feb 2011 at 9:22

GoogleCodeExporter commented 9 years ago
This issue was closed by revision r117.

Original comment by ondrej.zara on 4 Feb 2011 at 12:31

GoogleCodeExporter commented 9 years ago
Please try updating to latest SVN revision...

Original comment by ondrej.zara on 4 Feb 2011 at 12:32

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 9f586c228d6f.

Original comment by ondrej.zara on 20 Jun 2011 at 6:09