SQL Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near LIKE '%' at line 1.
Now diving into the code it appears that there's no database name. I forgot to add it, stupid enough. It might be a suggestion to generate a more appropiate errormessage? After all you can connect to the database without having selecting a database name.
Code: Select all
function TZMySQLDatabaseMetadata.UncachedGetTables(const Catalog: string;
const SchemaPattern: string; const TableNamePattern: string;
const Types: TStringDynArray): IZResultSet;
var
LCatalog, LTableNamePattern: string;
begin
Result := inherited UncachedGetTables(Catalog, SchemaPattern, TableNamePattern, Types);
GetCatalogAndNamePattern(Catalog, SchemaPattern, TableNamePattern,
LCatalog, LTableNamePattern);
if LCatalog='' then
raise Exception.Create('Error: missing catalog name');
with GetConnection.CreateStatement.ExecuteQuery(
Format('SHOW TABLES FROM %s LIKE ''%s''',
[GetIdentifierConvertor.Quote(LCatalog), LTableNamePattern])) do
begin