]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-5084 There is only one thing I can see that might be the case, try this patch...
authorAnthony Minessale <anthm@freeswitch.org>
Fri, 8 Feb 2013 19:18:13 +0000 (13:18 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Fri, 8 Feb 2013 19:18:13 +0000 (13:18 -0600)
src/mod/endpoints/mod_sofia/sofia_glue.c

index 7657488933f8396ce38057eb7617dea89fe996a7..85c08099dfedba1968814fee2f5ca6b31dde49b5 100644 (file)
@@ -6292,6 +6292,7 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
                
        switch_cache_db_handle_t *dbh = sofia_glue_get_db_handle(profile);
        char *test2;
+       char *err;
 
        if (!dbh) {
                return 0;
@@ -6309,14 +6310,20 @@ int sofia_glue_init_sql(sofia_profile_t *profile)
        
        test2 = switch_mprintf("%s;%s", test_sql, test_sql);
                        
-       if (switch_cache_db_execute_sql(dbh, test2, NULL) != SWITCH_STATUS_SUCCESS) {
-               switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "GREAT SCOTT!!! Cannot execute batched statements!\n"
-                                                 "If you are using mysql, make sure you are using MYODBC 3.51.18 or higher and enable FLAG_MULTI_STATEMENTS\n");
-               
-               switch_cache_db_release_db_handle(&dbh);
-               free(test2);
-               free(test_sql);
-               return 0;
+       if (switch_cache_db_execute_sql(dbh, test2, &err) != SWITCH_STATUS_SUCCESS) {
+
+               if (switch_stristr("read-only", err)) {
+                       free(err);
+               } else {
+                       switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "GREAT SCOTT!!! Cannot execute batched statements! [%s]\n"
+                                                         "If you are using mysql, make sure you are using MYODBC 3.51.18 or higher and enable FLAG_MULTI_STATEMENTS\n", err);
+                       
+                       switch_cache_db_release_db_handle(&dbh);
+                       free(test2);
+                       free(test_sql);
+                       free(err);
+                       return 0;
+               }
        }
 
        free(test2);