| Bug #67015 | SQLTablesW doesn't return schema in the MySQL ODBC driver 5.1.5 | ||
|---|---|---|---|
| Submitted: | 29 Sep 2012 6:32 | Modified: | 24 Oct 2012 9:30 |
| Reporter: | yan zhou | Email Updates: | |
| Status: | Not a Bug | Impact on me: | |
| Category: | Connector / ODBC | Severity: | S3 (Non-critical) |
| Version: | 5.1.5 | OS: | Any |
| Assigned to: | Bogdan Degtyariov | CPU Architecture: | Any |
[24 Oct 2012 9:30]
Bogdan Degtyariov
Hello Yan, MySQL Database does not support schemas. That is why the results returned by SQLTables() function have empty strings for the table schema. There is no such thing in MySQL as table's owner. The catalog parameter is representing the table's database. This is not a bug, just MySQL is operating with different objects than MSSQL.

Description: we try to get the tables' owner base on SQLTablesW as folowing: But the shcema(szOwnerName) is awlays empty. Dose the catolog(szCatalogName) equal to the table's owner? rc = SQLTablesW( hstmt, NULL, 0, NULL, 0, NULL, 0, L"VIEW,TABLE", 10 ); SQLBindCol(hstmt, 1, SQL_C_WCHAR, szCatalogName, STR_LEN, &cbCatalogName); SQLBindCol(hstmt, 2, SQL_C_WCHAR, szOwnerName, STR_LEN, &cbOwnerName); SQLBindCol(hstmt, 3, SQL_C_WCHAR, szColumnName, STR_LEN, &cbColumnName); How to repeat: get tables list as following, the szOwnerName is always empty rc = SQLTablesW( hstmt, NULL, 0, NULL, 0, NULL, 0, L"VIEW,TABLE", 10 ); SQLBindCol(hstmt, 1, SQL_C_WCHAR, szCatalogName, STR_LEN, &cbCatalogName); SQLBindCol(hstmt, 2, SQL_C_WCHAR, szOwnerName, STR_LEN, &cbOwnerName); SQLBindCol(hstmt, 3, SQL_C_WCHAR, szColumnName, STR_LEN, &cbColumnName);