From 4cbabd13f2553254bd0da7f486821131e9805fd4 Mon Sep 17 00:00:00 2001 From: huangqinjin Date: Tue, 5 Nov 2024 22:46:56 +0800 Subject: [PATCH] odbc: Fallback to string for unknown sql types --- src/ls_odbc.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/src/ls_odbc.c b/src/ls_odbc.c index 8e38d1a..d61504b 100644 --- a/src/ls_odbc.c +++ b/src/ls_odbc.c @@ -292,15 +292,6 @@ static int cur_shut(lua_State *L, cur_data *cur) */ static const char *sqltypetolua (const SQLSMALLINT type) { switch (type) { - case SQL_UNKNOWN_TYPE: case SQL_CHAR: case SQL_VARCHAR: - case SQL_TYPE_DATE: case SQL_TYPE_TIME: case SQL_TYPE_TIMESTAMP: - case SQL_DATE: case SQL_INTERVAL: case SQL_TIMESTAMP: - case SQL_LONGVARCHAR: - case SQL_WCHAR: case SQL_WVARCHAR: case SQL_WLONGVARCHAR: -#if (ODBCVER >= 0x0350) - case SQL_GUID: -#endif - return "string"; case SQL_BIGINT: case SQL_TINYINT: case SQL_INTEGER: case SQL_SMALLINT: #if LUA_VERSION_NUM>=503 @@ -314,8 +305,7 @@ static const char *sqltypetolua (const SQLSMALLINT type) { case SQL_BIT: return "boolean"; default: - assert(0); - return NULL; + return "string"; } }