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

Paul paul at iamfine.com
Thu Mar 7 07:24:07 MSK 2013


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.



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