"make current" has introduced lua dbh errors with ODBC to mysql
I ran a "make current" to our FS installation which was 2 years old, and was working perfectly. After the upgrade we are getting errors with the dbh function, which is called from our lua script, whereby the ODBC driver appears to be working but the submitted SQL commands show an error as if the database is not being accessed. We can run the same commands in MYSQL and get a correct result. I have seen a few threads discussing some changes in the dbh command but cant seem to find a work around. Attached is the LUA code, the "status" command from cli showing version and the error messages when running the test program. Any one have any ideas ?? Thanks in advance We wrote the following test lua script to isolate the problem and have found that the ODBC dri output from status --> FreeSWITCH (Version 1.3.16b git d7a9c18 2013-03-07 00:42:41Z) is ready 2013-03-07 04:17:28.984881 [DEBUG] freeswitch_lua.cpp:352 DBH handle 0xc61fc90 Connected. 2013-03-07 04:17:28.984881 [INFO] switch_cpp.cpp:1274 Successfully connected to the database 2013-03-07 04:17:28.984881 [ERR] switch_core_sqldb.c:1124 SQL ERR: [select count(*) from people] no such table: people 2013-03-07 04:17:28.984881 [ERR] freeswitch_lua.cpp:435 DBH NOT Connected. 2013-03-07 04:17:28.984881 [DEBUG] freeswitch_lua.cpp:370 DBH handle (nil) released. 2013-03-07 04:17:28.984881 [ERR] mod_lua.cpp:198 /usr/local/freeswitch/scripts/db_test.lua:13: assertion failed! LUA code is function debug(s) freeswitch.consoleLog("info", s .. "\n") end -- function debug(s) -- load the freeswitch.Dbh ODBC connector local dbh = assert(freeswitch.Dbh("iamfine")) row = {} if dbh:connected() == true then debug("Successfully connected to the database") local get_size = "select count(*) from people" assert (dbh:query(get_size, function(grow) for key, val in pairs (grow) do row[key] = val testcount = val end end )) debug("The table people IS populated with a record count of :: " ..testcount) end assert(dbh:release()) -- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/make-current-has-introduced-lu... Sent from the freeswitch-users mailing list archive at Nabble.com.
Try specifying the full dsn info instead of just the dsn name: local dbh = freeswitch.Dbh("dsn", "user", "pass")if dbh:connected() then...
Date: Wed, 6 Mar 2013 20:24:07 -0800 From: paul@iamfine.com To: freeswitch-users@lists.freeswitch.org Subject: [Freeswitch-users] "make current" has introduced lua dbh errors with ODBC to mysql
I ran a "make current" to our FS installation which was 2 years old, and was working perfectly. After the upgrade we are getting errors with the dbh function, which is called from our lua script, whereby the ODBC driver appears to be working but the submitted SQL commands show an error as if the database is not being accessed. We can run the same commands in MYSQL and get a correct result.
I have seen a few threads discussing some changes in the dbh command but cant seem to find a work around.
Attached is the LUA code, the "status" command from cli showing version and the error messages when running the test program.
Any one have any ideas ??
Thanks in advance
We wrote the following test lua script to isolate the problem and have found that the ODBC dri
output from status --> FreeSWITCH (Version 1.3.16b git d7a9c18 2013-03-07 00:42:41Z) is ready
2013-03-07 04:17:28.984881 [DEBUG] freeswitch_lua.cpp:352 DBH handle 0xc61fc90 Connected. 2013-03-07 04:17:28.984881 [INFO] switch_cpp.cpp:1274 Successfully connected to the database 2013-03-07 04:17:28.984881 [ERR] switch_core_sqldb.c:1124 SQL ERR: [select count(*) from people] no such table: people 2013-03-07 04:17:28.984881 [ERR] freeswitch_lua.cpp:435 DBH NOT Connected. 2013-03-07 04:17:28.984881 [DEBUG] freeswitch_lua.cpp:370 DBH handle (nil) released. 2013-03-07 04:17:28.984881 [ERR] mod_lua.cpp:198 /usr/local/freeswitch/scripts/db_test.lua:13: assertion failed!
LUA code is
function debug(s) freeswitch.consoleLog("info", s .. "\n") end -- function debug(s)
-- load the freeswitch.Dbh ODBC connector local dbh = assert(freeswitch.Dbh("iamfine")) row = {} if dbh:connected() == true then debug("Successfully connected to the database")
local get_size = "select count(*) from people"
assert (dbh:query(get_size, function(grow) for key, val in pairs (grow) do row[key] = val testcount = val end end ))
debug("The table people IS populated with a record count of :: " ..testcount) end assert(dbh:release())
-- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/make-current-has-introduced-lu... Sent from the freeswitch-users mailing list archive at Nabble.com.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Thank you very much That worked .... phew -- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/make-current-has-introduced-lu... Sent from the freeswitch-users mailing list archive at Nabble.com.
Great. This is probably related to http://wiki.freeswitch.org/wiki/Release_Notes#odbc-dsn -Steve On 7 March 2013 05:56, Paul <paul@iamfine.com> wrote:
Thank you very much
That worked .... phew
-- View this message in context: http://freeswitch-users.2379917.n2.nabble.com/make-current-has-introduced-lu... Sent from the freeswitch-users mailing list archive at Nabble.com.
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
participants (3)
-
DP .
-
Paul
-
Steven Ayre