Skip to content

Commit

Permalink
Added version-script for non-windows platform
Browse files Browse the repository at this point in the history
Fixed once again the testcase for odbc141 in prepare - checking native error to be either-or
updated .gitignore for new test names
Removed duplicate Stmt->Query free-ing
  • Loading branch information
lawrinn committed May 28, 2018
1 parent e674bd6 commit ea7a519
Show file tree
Hide file tree
Showing 5 changed files with 148 additions and 11 deletions.
23 changes: 23 additions & 0 deletions .gitignore
Expand Up @@ -31,6 +31,29 @@ ipch
Makefile
CPackConfig.cmake
CPackSourceConfig.cmake
test/odbc_basic
test/odbc_blob
test/odbc_bulk
test/odbc_catalog
testodbc_/curext
test/odbc_cursor
test/odbc_datetime
test/odbc_desc
test/odbc_dyn_cursor
test/odbc_error
test/odbc_info
test/odbc_keys
test/odbc_multistatement
test/odbc_param
test/odbc_prepare
test/odbc_relative
test/odbc_result1
test/odbc_result2
test/odbc_scroll
test/odbc_tran
test/odbc_types
test/odbc_unicode
test/odbc_use_result
test/basic
test/blob
test/bulk
Expand Down
14 changes: 9 additions & 5 deletions CMakeLists.txt
Expand Up @@ -237,12 +237,16 @@ ENDIF()
SET(LIBRARY_NAME "maodbc")
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/mariadb-odbc-driver.def.in
${CMAKE_SOURCE_DIR}/mariadb-odbc-driver-uni.def)
IF(WIN32)
ADD_LIBRARY(${LIBRARY_NAME} SHARED ${MARIADB_ODBC_SOURCES} ${CMAKE_SOURCE_DIR}/mariadb-odbc-driver-uni.def maodbcu.rc)
ELSE()
MESSAGE(STATUS "Version script: ${CMAKE_SOURCE_DIR}/maodbc.def")
ADD_LIBRARY(${LIBRARY_NAME} SHARED ${MARIADB_ODBC_SOURCES} maodbcu.rc)
SET_TARGET_PROPERTIES(${LIBRARY_NAME} PROPERTIES LINK_FLAGS "-Wl,--version-script=${CMAKE_SOURCE_DIR}/maodbc.def")
ENDIF()

####### MAODBC #######
ADD_LIBRARY(${LIBRARY_NAME} SHARED ${MARIADB_ODBC_SOURCES} ${CMAKE_SOURCE_DIR}/mariadb-odbc-driver-uni.def maodbcu.rc)

SET_TARGET_PROPERTIES(maodbc PROPERTIES LANGUAGE C)
TARGET_LINK_LIBRARIES(maodbc mariadbclient ${ODBC_INSTLIBS} ${PLATFORM_DEPENDENCIES})
SET_TARGET_PROPERTIES(${LIBRARY_NAME} PROPERTIES LANGUAGE C)
TARGET_LINK_LIBRARIES(${LIBRARY_NAME} mariadbclient ${ODBC_INSTLIBS} ${PLATFORM_DEPENDENCIES})

# Currently on Windows only
IF(WIN32)
Expand Down
1 change: 0 additions & 1 deletion ma_statement.c
Expand Up @@ -223,7 +223,6 @@ SQLRETURN MADB_StmtFree(MADB_Stmt *Stmt, SQLUSMALLINT Option)
MADB_FREE(Stmt->params);
MADB_FREE(Stmt->result);
MADB_FREE(Stmt->Cursor.Name);
MADB_DeleteQuery(&Stmt->Query);
MADB_FREE(Stmt->CatalogName);
MADB_FREE(Stmt->TableName);
ResetMetadata(&Stmt->metadata, NULL);
Expand Down
115 changes: 115 additions & 0 deletions maodbc.def
@@ -0,0 +1,115 @@
{
global:
SQLAllocConnect;
SQLAllocEnv;
SQLAllocHandle;
SQLAllocStmt;
SQLBindCol;
SQLBindParameter;
SQLBrowseConnect;
SQLBrowseConnectW;
SQLBulkOperations;
SQLCancel;
SQLCloseCursor;
SQLColAttribute;
SQLColAttributeW;
SQLColAttributes;
SQLColAttributesW;
SQLColumnPrivileges;
SQLColumnPrivilegesW;
SQLColumns;
SQLColumnsW;
SQLConnect;
SQLConnectW;
SQLCopyDesc;
SQLDescribeCol;
SQLDescribeColW;
SQLDescribeParam;
SQLDisconnect;
SQLDriverConnect;
SQLDriverConnectW;
SQLEndTran;
SQLError;
SQLErrorW;
SQLExecDirect;
SQLExecDirectW;
SQLExecute;
SQLExtendedFetch;
SQLFetch;
SQLFetchScroll;
SQLForeignKeys;
SQLForeignKeysW;
SQLFreeConnect;
SQLFreeEnv;
SQLFreeHandle;
SQLFreeStmt;
SQLGetConnectAttr;
SQLGetConnectAttrW;
SQLGetConnectOption;
SQLGetConnectOptionW;
SQLGetCursorName;
SQLGetCursorNameW;
SQLGetData;
SQLGetDescField;
SQLGetDescFieldW;
SQLGetDescRec;
SQLGetDescRecW;
SQLGetDiagField;
SQLGetDiagFieldW;
SQLGetDiagRec;
SQLGetDiagRecW;
SQLGetEnvAttr;
SQLGetFunctions;
SQLGetInfo;
SQLGetInfoW;
SQLGetStmtAttr;
SQLGetStmtAttrW;
SQLGetStmtOption;
SQLGetTypeInfo;
SQLGetTypeInfoW;
SQLMoreResults;
SQLNativeSql;
SQLNativeSqlW;
SQLNumParams;
SQLNumResultCols;
SQLParamData;
SQLParamOptions;
SQLPrepare;
SQLPrepareW;
SQLPrimaryKeys;
SQLPrimaryKeysW;
SQLProcedureColumns;
SQLProcedureColumnsW;
SQLProcedures;
SQLProceduresW;
SQLPutData;
SQLRowCount;
SQLSetConnectAttr;
SQLSetConnectAttrW;
SQLSetConnectOption;
SQLSetConnectOptionW;
SQLSetCursorName;
SQLSetCursorNameW;
SQLSetDescField;
SQLSetDescFieldW;
SQLSetDescRec;
SQLSetDescRecW;
SQLSetEnvAttr;
SQLSetParam;
SQLSetPos;
SQLSetScrollOptions;
SQLSetStmtAttr;
SQLSetStmtAttrW;
SQLSetStmtOption;
SQLSpecialColumns;
SQLSpecialColumnsW;
SQLStatistics;
SQLStatisticsW;
SQLTablePrivileges;
SQLTablePrivilegesW;
SQLTables;
SQLTablesW;
SQLTransact;
local:
*;
};
6 changes: 1 addition & 5 deletions test/prepare.c
Expand Up @@ -1211,11 +1211,7 @@ ODBC_TEST(t_odbc141)

SQLGetDiagRec(SQL_HANDLE_STMT, Stmt, 1, SQLState, &NativeError, SQLMessage, SQL_MAX_MESSAGE_LENGTH, &TextLengthPtr);
diag("%s(%d) %s", SQLState, NativeError, SQLMessage);
#ifdef _WIN32
is_num(NativeError, 29); /* File not found */
#else
is_num(NativeError, 13); /* Can't stat... */
#endif
FAIL_IF(NativeError!=29 && NativeError != 13, "Expected 13 or 29 native error"); /* File not found or No such file or directory... */

CHECK_STMT_RC(Stmt, SQLFreeStmt(Stmt, SQL_CLOSE));

Expand Down

0 comments on commit ea7a519

Please sign in to comment.