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