Description:
SQLRETURN rc = ::SQLTables(
pSQL->Gethstmt(),
( SQLCHAR * ) "mysql",
( SQLSMALLINT ) 5,
( SQLCHAR * ) NULL,
( SQLSMALLINT ) 0,
( SQLCHAR * ) NULL,
( SQLSMALLINT ) 0 ,
( SQLCHAR * ) "TABLE",
( SQLSMALLINT ) 5 );
Should get all tables in the schema "mysql" instead gets one row:
table_cat: mysql
table_name: NULL
table_type: None
Works correctly in MySQL ODBC 3.51 driver 3.51.27
How to repeat:
Execute code fragment above
Suggested fix:
Allow caller to pass you NULL for table_name and 0 for cbTableName to get all tables
accessible for a schema without having to enter a search pattern. The following is
Microsoft documentation:
http://msdn.microsoft.com/en-us/library/ms131341.aspx?ppud=4
// Get a list of all tables in the current database.
SQLTables(hstmt, NULL, 0, NULL, 0, NULL, 0, NULL,0);
// Get a list of all tables in all databases.
SQLTables(hstmt, (SQLCHAR*) "%", SQL_NTS, NULL, 0, NULL, 0, NULL,0);
Description: SQLRETURN rc = ::SQLTables( pSQL->Gethstmt(), ( SQLCHAR * ) "mysql", ( SQLSMALLINT ) 5, ( SQLCHAR * ) NULL, ( SQLSMALLINT ) 0, ( SQLCHAR * ) NULL, ( SQLSMALLINT ) 0 , ( SQLCHAR * ) "TABLE", ( SQLSMALLINT ) 5 ); Should get all tables in the schema "mysql" instead gets one row: table_cat: mysql table_name: NULL table_type: None Works correctly in MySQL ODBC 3.51 driver 3.51.27 How to repeat: Execute code fragment above Suggested fix: Allow caller to pass you NULL for table_name and 0 for cbTableName to get all tables accessible for a schema without having to enter a search pattern. The following is Microsoft documentation: http://msdn.microsoft.com/en-us/library/ms131341.aspx?ppud=4 // Get a list of all tables in the current database. SQLTables(hstmt, NULL, 0, NULL, 0, NULL, 0, NULL,0); // Get a list of all tables in all databases. SQLTables(hstmt, (SQLCHAR*) "%", SQL_NTS, NULL, 0, NULL, 0, NULL,0);