[Freeswitch-users] "make current" has introduced lua dbh errors with ODBC to mysql

DP . hi-tecc at hotmail.com
Thu Mar 7 08:40:15 MSK 2013


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 at iamfine.com
> To: freeswitch-users at 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-lua-dbh-errors-with-ODBC-to-mysql-tp7588326.html
> Sent from the freeswitch-users mailing list archive at Nabble.com.
> 
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
> 
> 
> 
> 
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://wiki.freeswitch.org
> http://www.cluecon.com
> 
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20130307/02f76b17/attachment.html 


Join us at ClueCon 2011 Aug 9-11, 2011
More information about the FreeSWITCH-users mailing list