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