blag / wwwsqldesigner

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

php-dbo backend issue with tables/views not found in information_schema.statistics when building $keys[] index #176

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. click save/load
2. select backend php-pdo 
3. click import from DB
4. Enter a database that has tables that aren't listed in the 
information_schema.statistics table.  Or a database that has VIEWS.
5. Alternative Step: 
Navigate to 
http://localhost/wwwsqldesigner-2.7/backend/php-pdo/index.php?action=import&data
base=[database]

What is the expected output? What do you see instead?
Steps 1 -4:
Expected output is the database er diagram.

Instead an alert is presented:
XML error: NULL Output

Step 5:
Expected output is XML data representing the database er diagram.

Instead a php alert is issued for an undefined index on line 174 of 
LayerMYSQL.php

What version of the product are you using? On what operating system?
Version: 2.7
OS: Windows 7
WAMP stack

Please provide any additional information below.
Problem:
public static function Keys($table)
{
...
line 174: return self::$keys[$table['name']];
...
}

Doesn't take into account that the table name might not exist in the 
information_schema.statistics table and therefore not be an entry in the 
$keys[] index.

Fix:
Mimicked the public static function Relations() return if clause:
public static function Keys($table)
{
...
if(isset(self::$keys[$table['name']]))
return self::$keys[$table['name']];
return array();
...
}

Thanks!
Jeremy

Original issue reported on code.google.com by jeremy.s...@gmail.com on 29 Oct 2013 at 6:02

GoogleCodeExporter commented 9 years ago

Original comment by ondrej.zara on 31 Oct 2013 at 5:12

GoogleCodeExporter commented 9 years ago
Shall be fixed in 
http://code.google.com/p/wwwsqldesigner/source/detail?r=6706800e25899a71c86796f5
f48bbf5262035f21. Can you please confirm?

Original comment by ondrej.zara on 31 Oct 2013 at 5:21

GoogleCodeExporter commented 9 years ago
Yes, that's it.  Thanks for addressing this so quickly!

Original comment by jeremy.s...@gmail.com on 4 Nov 2013 at 5:02