From b88841c6ef26c8ee3e604aae2816f7abffc20a33 Mon Sep 17 00:00:00 2001 From: Arkshine Date: Fri, 10 Apr 2015 17:08:08 +0200 Subject: [PATCH] Fix missing SQL_SetCharset native in SQLite --- modules/sqlite/basic_sql.cpp | 7 +++++++ modules/sqlite/msvc12/sqlite.vcxproj.filters | 4 ++-- plugins/include/sqlx.inc | 3 ++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/modules/sqlite/basic_sql.cpp b/modules/sqlite/basic_sql.cpp index 6dd2fb3d..a4ae8a20 100644 --- a/modules/sqlite/basic_sql.cpp +++ b/modules/sqlite/basic_sql.cpp @@ -595,6 +595,12 @@ static cell AMX_NATIVE_CALL SQL_QuoteStringFmt(AMX *amx, cell *params) } } +static cell AMX_NATIVE_CALL SQL_SetCharset(AMX *amx, cell *params) +{ + /* SQLite supports only UTF-8/16 */ + return 0; +} + AMX_NATIVE_INFO g_BaseSqlNatives[] = { {"SQL_MakeDbTuple", SQL_MakeDbTuple}, @@ -620,6 +626,7 @@ AMX_NATIVE_INFO g_BaseSqlNatives[] = {"SQL_QuoteString", SQL_QuoteString}, {"SQL_QuoteStringFmt", SQL_QuoteStringFmt}, {"SQL_NextResultSet", SQL_NextResultSet}, + {"SQL_SetCharset", SQL_SetCharset}, {NULL, NULL}, }; diff --git a/modules/sqlite/msvc12/sqlite.vcxproj.filters b/modules/sqlite/msvc12/sqlite.vcxproj.filters index cbc554b4..c2e957b4 100644 --- a/modules/sqlite/msvc12/sqlite.vcxproj.filters +++ b/modules/sqlite/msvc12/sqlite.vcxproj.filters @@ -80,7 +80,7 @@ Module SDK\SDK Base - + SQLite Source @@ -136,7 +136,7 @@ Module SDK - + SQLite Source diff --git a/plugins/include/sqlx.inc b/plugins/include/sqlx.inc index def1c69c..f8bf6619 100644 --- a/plugins/include/sqlx.inc +++ b/plugins/include/sqlx.inc @@ -67,7 +67,8 @@ native Handle:SQL_Connect(Handle:cn_tuple, &errcode, error[], maxlength); * * If a connection tuple is supplied, this should be called before SQL_Connect or SQL_ThreadQuery. * Also note the change will remain until you call this function with another value. - * + * This native does nothing in SQLite. + * * Example: "utf8", "latin1" * * @param h Database or connection tuple Handle.