Author: cazfi
Date: Fri Mar 31 17:53:33 2017
New Revision: 35174

URL: http://svn.gna.org/viewcvs/freeciv?rev=35174&view=rev
Log:
Updated included luasql files to luasql-2.3.5 level.

See hrm Feature #648391

Modified:
    branches/S2_6/dependencies/luasql/README
    branches/S2_6/dependencies/luasql/Version
    branches/S2_6/dependencies/luasql/src/ls_mysql.c
    branches/S2_6/dependencies/luasql/src/ls_postgres.c
    branches/S2_6/dependencies/luasql/src/ls_sqlite3.c
    branches/S2_6/dependencies/luasql/src/luasql.c

Modified: branches/S2_6/dependencies/luasql/README
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/dependencies/luasql/README?rev=35174&r1=35173&r2=35174&view=diff
==============================================================================
--- branches/S2_6/dependencies/luasql/README    (original)
+++ branches/S2_6/dependencies/luasql/README    Fri Mar 31 17:53:33 2017
@@ -1,5 +1,5 @@
 LuaSQL
-http://keplerproject.github.io/luasql/doc/us/
+http://keplerproject.github.io/luasql
 
 LuaSQL is a simple interface from Lua to a DBMS. It enables a Lua program to:
 

Modified: branches/S2_6/dependencies/luasql/Version
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/dependencies/luasql/Version?rev=35174&r1=35173&r2=35174&view=diff
==============================================================================
--- branches/S2_6/dependencies/luasql/Version   (original)
+++ branches/S2_6/dependencies/luasql/Version   Fri Mar 31 17:53:33 2017
@@ -1,5 +1,5 @@
-Sources here are fron luasql git tag v2.3.4
-(https://github.com/keplerproject/luasql/tree/v2.3.4)
+Sources here are fron luasql git tag v2.3.5
+(https://github.com/keplerproject/luasql/tree/v2.3.5)
 
 Only the files needed by freeciv are included here, not entire luasql
 source directory hierarchy.

Modified: branches/S2_6/dependencies/luasql/src/ls_mysql.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/dependencies/luasql/src/ls_mysql.c?rev=35174&r1=35173&r2=35174&view=diff
==============================================================================
--- branches/S2_6/dependencies/luasql/src/ls_mysql.c    (original)
+++ branches/S2_6/dependencies/luasql/src/ls_mysql.c    Fri Mar 31 17:53:33 2017
@@ -532,6 +532,7 @@
                lua_pushboolean (L, 0);
                return 1;
        }
+       mysql_library_end();
        env->closed = 1;
        lua_pushboolean (L, 1);
        return 1;
@@ -601,7 +602,7 @@
        lua_newtable(L);
        luaL_setfuncs(L, driver, 0);
        luasql_set_info (L);
-    lua_pushliteral (L, "_MYSQLVERSION");
+    lua_pushliteral (L, "_CLIENTVERSION");
     lua_pushliteral (L, MYSQL_SERVER_VERSION);
     lua_settable (L, -3);
        return 1;

Modified: branches/S2_6/dependencies/luasql/src/ls_postgres.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/dependencies/luasql/src/ls_postgres.c?rev=35174&r1=35173&r2=35174&view=diff
==============================================================================
--- branches/S2_6/dependencies/luasql/src/ls_postgres.c (original)
+++ branches/S2_6/dependencies/luasql/src/ls_postgres.c Fri Mar 31 17:53:33 2017
@@ -621,5 +621,10 @@
        lua_newtable (L);
        luaL_setfuncs (L, driver, 0);
        luasql_set_info (L);
-       return 1;
-}
+#if defined(PQlibVersion)
+       lua_pushliteral (L, "_CLIENTVERSION");
+       lua_pushinteger (L, PQlibVersion());
+       lua_settable (L, -3);
+#endif
+       return 1;
+}

Modified: branches/S2_6/dependencies/luasql/src/ls_sqlite3.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/dependencies/luasql/src/ls_sqlite3.c?rev=35174&r1=35173&r2=35174&view=diff
==============================================================================
--- branches/S2_6/dependencies/luasql/src/ls_sqlite3.c  (original)
+++ branches/S2_6/dependencies/luasql/src/ls_sqlite3.c  Fri Mar 31 17:53:33 2017
@@ -498,7 +498,7 @@
     {
       conn->auto_commit = 1;
       /* undo active transaction - ignore errors */
-      sqlite3_exec(conn->sql_conn, "ROLLBACK", NULL, NULL, NULL);
+      (void) sqlite3_exec(conn->sql_conn, "ROLLBACK", NULL, NULL, NULL);
     }
   else
     {
@@ -554,7 +554,14 @@
   sourcename = luaL_checkstring(L, 2);
 
 #if SQLITE_VERSION_NUMBER > 3006013
-  res = sqlite3_open_v2(sourcename, &conn, SQLITE_OPEN_READWRITE | 
SQLITE_OPEN_CREATE, NULL);
+  if (strstr(sourcename, ":memory:")) /* TODO: rework this and get/add param 
'flag' for sqlite3_open_v2 - see TODO below */
+  {
+         res = sqlite3_open_v2(sourcename, &conn, SQLITE_OPEN_READWRITE | 
SQLITE_OPEN_MEMORY, NULL);
+  }
+  else
+  {
+         res = sqlite3_open_v2(sourcename, &conn, SQLITE_OPEN_READWRITE | 
SQLITE_OPEN_CREATE, NULL);
+  }
 #else
   res = sqlite3_open(sourcename, &conn);
 #endif
@@ -678,5 +685,8 @@
   lua_newtable (L);
   luaL_setfuncs (L, driver, 0);
   luasql_set_info (L);
-  return 1;
-}
+  lua_pushliteral (L, "_CLIENTVERSION");
+  lua_pushliteral (L, SQLITE_VERSION);
+  lua_settable (L, -3);
+  return 1;
+}

Modified: branches/S2_6/dependencies/luasql/src/luasql.c
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/dependencies/luasql/src/luasql.c?rev=35174&r1=35173&r2=35174&view=diff
==============================================================================
--- branches/S2_6/dependencies/luasql/src/luasql.c      (original)
+++ branches/S2_6/dependencies/luasql/src/luasql.c      Fri Mar 31 17:53:33 2017
@@ -122,12 +122,12 @@
 */
 LUASQL_API void luasql_set_info (lua_State *L) {
        lua_pushliteral (L, "_COPYRIGHT");
-       lua_pushliteral (L, "Copyright (C) 2003-2016 Kepler Project");
+       lua_pushliteral (L, "Copyright (C) 2003-2017 Kepler Project");
        lua_settable (L, -3);
        lua_pushliteral (L, "_DESCRIPTION");
        lua_pushliteral (L, "LuaSQL is a simple interface from Lua to a DBMS");
        lua_settable (L, -3);
        lua_pushliteral (L, "_VERSION");
-       lua_pushliteral (L, "LuaSQL 2.3.4 (for "LUA_VERSION")");
+       lua_pushliteral (L, "LuaSQL 2.3.5 (for "LUA_VERSION")");
        lua_settable (L, -3);
 }


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to