Calling SQLTables fails with an error on invalid string error. It seems that it's the TABLE_COMMENT / REMARK column that fails in MADB_ConvertAnsi2Unicode. This has been tested and reproduces with MariaDB 10.2.1 and with MariaDB ColumnStore 1.0.2, but not on MariaDB 10.1.16. Looking at the ODBC Driver sources, I see that the REMARK column is sometimes mapped to NULL and sometimes to TABLE_COMMENT. As the ODBC driver is really important for MariaDB ColumnStore, this is significant. Running Business Objects on MariaDB CS is, due to this issue, not possible at this point in time.The following code illustrates the issue.
#include <stdio.h>
|
#include <sqlext.h>
|
|
int main(int argc, char *argv[])
|
{
|
SQLHANDLE hEnv, hConn, hStmt;
|
SQLRETURN nRet;
|
SQLCHAR szErrMsg[256];
|
SQLCHAR szErrState[5];
|
SQLINTEGER nErrNative;
|
SQLSMALLINT nErrMsgLen;
|
SQLSMALLINT nDiagRec;
|
SQLSMALLINT nCols;
|
SQLCHAR szCatalog[64];
|
SQLLEN iCatalog;
|
SQLCHAR szSchema[64];
|
SQLLEN iSchema;
|
SQLCHAR szName[64];
|
SQLLEN iName;
|
SQLCHAR szType[64];
|
SQLLEN iType;
|
SQLCHAR szRemarks[3096];
|
SQLLEN iRemarks;
|
|
if(argc < 3)
|
{
|
fprintf(stderr, "Usage: %s <DSN> <user> <password>\n", argv[0]);
|
return 1;
|
}
|
|
SQLAllocHandle(SQL_HANDLE_ENV, SQL_NULL_HANDLE, &hEnv);
|
SQLSetEnvAttr(hEnv, SQL_ATTR_ODBC_VERSION, (void *) SQL_OV_ODBC3, 0);
|
SQLAllocHandle(SQL_HANDLE_DBC, hEnv, &hConn);
|
if((nRet = SQLConnect(hConn, argv[1], SQL_NTS, argv[2], SQL_NTS, argv[3], SQL_NTS)) != SQL_SUCCESS)
|
{
|
SQLError(hEnv, hConn, SQL_NULL_HSTMT, NULL, NULL, szErrMsg, sizeof(szErrMsg), NULL);
|
fprintf(stderr, "Error in connecting to MariaDB:\n%s\n", szErrMsg);
|
|
return 1;
|
}
|
|
SQLAllocHandle(SQL_HANDLE_STMT, hConn, &hStmt);
|
SQLBindCol(hStmt, 1, SQL_C_WCHAR, szCatalog, sizeof(szCatalog), &iCatalog);
|
SQLBindCol(hStmt, 2, SQL_C_WCHAR, szSchema, sizeof(szSchema), &iSchema);
|
SQLBindCol(hStmt, 3, SQL_C_WCHAR, szName, sizeof(szName), &iName);
|
SQLBindCol(hStmt, 4, SQL_C_WCHAR, szType, sizeof(szType), &iType);
|
SQLBindCol(hStmt, 5, SQL_C_WCHAR, szRemarks, sizeof(szRemarks), &iRemarks);
|
if((nRet = SQLTables(hStmt, "test", SQL_NTS, NULL, SQL_NTS, NULL, SQL_NTS, NULL, SQL_NTS)) != SQL_SUCCESS)
|
{
|
SQLError(hEnv, hConn, hStmt, NULL, NULL, szErrMsg, sizeof(szErrMsg), NULL);
|
fprintf(stderr, "Error in SQLTables:\n%s\n", szErrMsg);
|
|
return 1;
|
}
|
SQLNumResultCols(hStmt, &nCols);
|
printf("Cols: %d\n", nCols);
|
while((nRet = SQLFetch(hStmt)) == SQL_SUCCESS)
|
{
|
}
|
if(nRet != SQL_NO_DATA)
|
{
|
for(nDiagRec = 1; ; nDiagRec++)
|
{
|
if(SQLGetDiagRec(SQL_HANDLE_STMT, hStmt, nDiagRec, szErrState, &nErrNative,
|
szErrMsg, sizeof(szErrMsg), &nErrMsgLen) != SQL_SUCCESS)
|
break;
|
fprintf(stderr, "Error %d in SQLFetch %d %.5s\n%.*s\n", nDiagRec, nErrNative,
|
szErrState, nErrMsgLen, szErrMsg);
|
}
|
|
return 1;
|
}
|
SQLFreeHandle(SQL_HANDLE_STMT, hStmt);
|
SQLFreeHandle(SQL_HANDLE_DBC, hConn);
|
SQLFreeHandle(SQL_HANDLE_ENV, hEnv);
|
|
return 0;
|
}
|
Transition |
Time In Source Status |
Execution Times |
Open |
|
Closed |
|
6d 11h 9m
|
1
|
{"report":{"fcp":849.1999999880791,"ttfb":225,"pageVisibility":"visible","entityId":57887,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":1,"journeyId":"187f544d-3ff9-4fec-899f-aebbdebb0e3e","navigationType":0,"readyForUser":938.1999999880791,"redirectCount":0,"resourceLoadedEnd":974.1000000238419,"resourceLoadedStart":230.80000001192093,"resourceTiming":[{"duration":100.89999997615814,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":230.80000001192093,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":230.80000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":331.69999998807907,"responseStart":0,"secureConnectionStart":0},{"duration":102.89999997615814,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":231,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":231,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":333.89999997615814,"responseStart":0,"secureConnectionStart":0},{"duration":159.39999997615814,"initiatorType":"script","name":"https://jira.mariadb.org/s/fbf975c0cce4b1abf04784eeae9ba1f4-CDN/lu2bu7/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":231.10000002384186,"connectEnd":231.10000002384186,"connectStart":231.10000002384186,"domainLookupEnd":231.10000002384186,"domainLookupStart":231.10000002384186,"fetchStart":231.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":231.10000002384186,"responseEnd":390.5,"responseStart":390.5,"secureConnectionStart":231.10000002384186},{"duration":234.19999998807907,"initiatorType":"script","name":"https://jira.mariadb.org/s/099b33461394b8015fc36c0a4b96e19f-CDN/lu2bu7/820016/12ta74/8679b4946efa1a0bb029a3a22206fb5d/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":231.30000001192093,"connectEnd":231.30000001192093,"connectStart":231.30000001192093,"domainLookupEnd":231.30000001192093,"domainLookupStart":231.30000001192093,"fetchStart":231.30000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":231.30000001192093,"responseEnd":465.5,"responseStart":465.5,"secureConnectionStart":231.30000001192093},{"duration":237.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/94c15bff32baef80f4096a08aceae8bc-CDN/lu2bu7/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":231.5,"connectEnd":231.5,"connectStart":231.5,"domainLookupEnd":231.5,"domainLookupStart":231.5,"fetchStart":231.5,"redirectEnd":0,"redirectStart":0,"requestStart":231.5,"responseEnd":469,"responseStart":469,"secureConnectionStart":231.5},{"duration":237.9000000357628,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":231.69999998807907,"connectEnd":231.69999998807907,"connectStart":231.69999998807907,"domainLookupEnd":231.69999998807907,"domainLookupStart":231.69999998807907,"fetchStart":231.69999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":231.69999998807907,"responseEnd":469.60000002384186,"responseStart":469.60000002384186,"secureConnectionStart":231.69999998807907},{"duration":238.60000002384186,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":231.89999997615814,"connectEnd":231.89999997615814,"connectStart":231.89999997615814,"domainLookupEnd":231.89999997615814,"domainLookupStart":231.89999997615814,"fetchStart":231.89999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":231.89999997615814,"responseEnd":470.5,"responseStart":470.5,"secureConnectionStart":231.89999997615814},{"duration":297.80000001192093,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2bu7/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":232,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":232,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":529.8000000119209,"responseStart":0,"secureConnectionStart":0},{"duration":238.80000001192093,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":232.19999998807907,"connectEnd":232.19999998807907,"connectStart":232.19999998807907,"domainLookupEnd":232.19999998807907,"domainLookupStart":232.19999998807907,"fetchStart":232.19999998807907,"redirectEnd":0,"redirectStart":0,"requestStart":232.19999998807907,"responseEnd":471,"responseStart":471,"secureConnectionStart":232.19999998807907},{"duration":297.69999998807907,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2bu7/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":232.30000001192093,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":232.30000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":530,"responseStart":0,"secureConnectionStart":0},{"duration":239.30000001192093,"initiatorType":"script","name":"https://jira.mariadb.org/s/3339d87fa2538a859872f2df449bf8d0-CDN/lu2bu7/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":232.39999997615814,"connectEnd":232.39999997615814,"connectStart":232.39999997615814,"domainLookupEnd":232.39999997615814,"domainLookupStart":232.39999997615814,"fetchStart":232.39999997615814,"redirectEnd":0,"redirectStart":0,"requestStart":232.39999997615814,"responseEnd":471.69999998807907,"responseStart":471.69999998807907,"secureConnectionStart":232.39999997615814},{"duration":552.3999999761581,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":233.10000002384186,"connectEnd":233.10000002384186,"connectStart":233.10000002384186,"domainLookupEnd":233.10000002384186,"domainLookupStart":233.10000002384186,"fetchStart":233.10000002384186,"redirectEnd":0,"redirectStart":0,"requestStart":233.10000002384186,"responseEnd":785.5,"responseStart":785.5,"secureConnectionStart":233.10000002384186},{"duration":618.8999999761581,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":233.30000001192093,"connectEnd":233.30000001192093,"connectStart":233.30000001192093,"domainLookupEnd":233.30000001192093,"domainLookupStart":233.30000001192093,"fetchStart":233.30000001192093,"redirectEnd":0,"redirectStart":0,"requestStart":233.30000001192093,"responseEnd":852.1999999880791,"responseStart":852.1999999880791,"secureConnectionStart":233.30000001192093},{"duration":258.7000000476837,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":540.8999999761581,"connectEnd":540.8999999761581,"connectStart":540.8999999761581,"domainLookupEnd":540.8999999761581,"domainLookupStart":540.8999999761581,"fetchStart":540.8999999761581,"redirectEnd":0,"redirectStart":0,"requestStart":540.8999999761581,"responseEnd":799.6000000238419,"responseStart":799.6000000238419,"secureConnectionStart":540.8999999761581},{"duration":172.80000001192093,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":843,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":843,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1015.8000000119209,"responseStart":0,"secureConnectionStart":0},{"duration":116.20000004768372,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2bu7/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/css/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":857.8999999761581,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":857.8999999761581,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":974.1000000238419,"responseStart":0,"secureConnectionStart":0},{"duration":78.40000003576279,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2bu7/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-project.issue.navigator,-jira.view.issue,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":858.6999999880791,"connectEnd":858.6999999880791,"connectStart":858.6999999880791,"domainLookupEnd":858.6999999880791,"domainLookupStart":858.6999999880791,"fetchStart":858.6999999880791,"redirectEnd":0,"redirectStart":0,"requestStart":858.6999999880791,"responseEnd":937.1000000238419,"responseStart":937,"secureConnectionStart":858.6999999880791},{"duration":82.19999998807907,"initiatorType":"script","name":"https://jira.mariadb.org/s/f51ef5507eea4c158f257c66c93b2a3f-CDN/lu2bu7/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/js/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":859.1999999880791,"connectEnd":859.1999999880791,"connectStart":859.1999999880791,"domainLookupEnd":859.1999999880791,"domainLookupStart":859.1999999880791,"fetchStart":859.1999999880791,"redirectEnd":0,"redirectStart":0,"requestStart":859.1999999880791,"responseEnd":941.3999999761581,"responseStart":941.3999999761581,"secureConnectionStart":859.1999999880791}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":51,"responseStart":225,"responseEnd":228,"domLoading":228,"domInteractive":1033,"domContentLoadedEventStart":1033,"domContentLoadedEventEnd":1079,"domComplete":1224,"loadEventStart":1224,"loadEventEnd":1224,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1022.6999999880791},{"name":"bigPipe.sidebar-id.end","time":1023.3999999761581},{"name":"bigPipe.activity-panel-pipe-id.start","time":1023.6000000238419},{"name":"bigPipe.activity-panel-pipe-id.end","time":1024.300000011921},{"name":"activityTabFullyLoaded","time":1094.5}],"measures":[],"correlationId":"7d09a4d4c2d030","effectiveType":"4g","downlink":9.3,"rtt":0,"serverDuration":106,"dbReadsTimeInMs":13,"dbConnsTimeInMs":21,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}