[svn-commits] tilghman: branch 1.6.1 r1016 - /branches/1.6.1/res/res_config_mysql.c

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue Aug 18 14:42:49 CDT 2009


Author: tilghman
Date: Tue Aug 18 14:42:44 2009
New Revision: 1016

URL: http://svn.asterisk.org/svn-view/asterisk-addons?view=rev&rev=1016
Log:
Clarify some of the error messages, to help upgraders.

Modified:
    branches/1.6.1/res/res_config_mysql.c

Modified: branches/1.6.1/res/res_config_mysql.c
URL: http://svn.asterisk.org/svn-view/asterisk-addons/branches/1.6.1/res/res_config_mysql.c?view=diff&rev=1016&r1=1015&r2=1016
==============================================================================
--- branches/1.6.1/res/res_config_mysql.c (original)
+++ branches/1.6.1/res/res_config_mysql.c Tue Aug 18 14:42:44 2009
@@ -215,7 +215,7 @@
 	}
 
 	if (mysql_real_query(&dbh->handle, sql->str, sql->used)) {
-		ast_log(LOG_ERROR, "Failed to query database columns: %s\n", mysql_error(&dbh->handle));
+		ast_log(LOG_ERROR, "Failed to query database '%s', table '%s' columns: %s\n", database, tablename, mysql_error(&dbh->handle));
 		release_database(dbh);
 		AST_LIST_UNLOCK(&mysql_tables);
 		return NULL;
@@ -245,7 +245,7 @@
 			}
 
 			if (!(column = ast_calloc(1, sizeof(*column) + strlen(fname) + strlen(ftype) + strlen(fdflt) + 3))) {
-				ast_log(LOG_ERROR, "Unable to allocate column element for %s, %s\n", tablename, fname);
+				ast_log(LOG_ERROR, "Unable to allocate column element %s for %s\n", fname, tablename);
 				destroy_table(table);
 				release_database(dbh);
 				AST_LIST_UNLOCK(&mysql_tables);
@@ -314,7 +314,7 @@
 	struct ast_variable *var=NULL, *prev=NULL;
 
 	if (!(dbh = find_database(database, 0))) {
-		ast_log(LOG_WARNING, "MySQL RealTime: Invalid database specified: %s\n", database);
+		ast_log(LOG_WARNING, "MySQL RealTime: Invalid database specified: %s (check res_mysql.conf)\n", database);
 		return NULL;
 	}
 
@@ -422,7 +422,7 @@
 	struct ast_category *cat = NULL;
 
 	if (!(dbh = find_database(database, 0))) {
-		ast_log(LOG_WARNING, "MySQL RealTime: Invalid database specified: '%s'\n", database);
+		ast_log(LOG_WARNING, "MySQL RealTime: Invalid database specified: '%s' (check res_mysql.conf)\n", database);
 		return NULL;
 	}
 
@@ -543,7 +543,7 @@
 	struct columns *column = NULL;
 
 	if (!(dbh = find_database(database, 1))) {
-		ast_log(LOG_WARNING, "MySQL RealTime: Invalid database specified: '%s'.\n", database);
+		ast_log(LOG_WARNING, "MySQL RealTime: Invalid database specified: '%s' (check res_mysql.conf)\n", database);
 		return -1;
 	}
 		
@@ -560,7 +560,7 @@
 	}
 
 	if (!(column = find_column(table, keyfield))) {
-		ast_log(LOG_ERROR, "MySQL RealTime: Updating on column '%s', but that column does not exist within the table '%s'!\n", keyfield, tablename);
+		ast_log(LOG_ERROR, "MySQL RealTime: Updating on column '%s', but that column does not exist within the table '%s' (db '%s')!\n", keyfield, tablename, database);
 		release_table(table);
 		release_database(dbh);
 		return -1;
@@ -570,7 +570,7 @@
 	newparam = va_arg(ap, const char *);
 	newval = va_arg(ap, const char *);
 	if (!newparam || !newval)  {
-		ast_log(LOG_WARNING, "MySQL RealTime: Realtime retrieval requires at least 1 parameter and 1 value to search on.\n");
+		ast_log(LOG_WARNING, "MySQL RealTime: Realtime update requires at least 1 parameter and 1 value to update.\n");
 		release_table(table);
 		release_database(dbh);
 		return -1;
@@ -578,7 +578,7 @@
 
 	/* Check that the column exists in the table */
 	if (!(column = find_column(table, newparam))) {
-		ast_log(LOG_ERROR, "MySQL RealTime: Updating on column '%s', but that column does not exist within the table '%s'!\n", newparam, tablename);
+		ast_log(LOG_ERROR, "MySQL RealTime: Updating column '%s', but that column does not exist within the table '%s' (first pair MUST exist)!\n", newparam, tablename);
 		release_table(table);
 		release_database(dbh);
 		return -1;
@@ -631,7 +631,7 @@
 
 	/* Execution. */
 	if (mysql_real_query(&dbh->handle, sql->str, sql->used)) {
-		ast_log(LOG_WARNING, "MySQL RealTime: Failed to query database: %s\n", mysql_error(&dbh->handle));
+		ast_log(LOG_WARNING, "MySQL RealTime: Failed to update database: %s\n", mysql_error(&dbh->handle));
 		release_table(table);
 		release_database(dbh);
 		return -1;
@@ -663,7 +663,7 @@
 	const char *newparam, *newval;
 
 	if (!(dbh = find_database(database, 1))) {
-		ast_log(LOG_WARNING, "MySQL RealTime: Invalid database specified: '%s'.\n", database);
+		ast_log(LOG_WARNING, "MySQL RealTime: Invalid database specified: '%s' (check res_mysql.conf)\n", database);
 		return -1;
 	}
 
@@ -714,7 +714,7 @@
 
 	/* Execution. */
 	if (mysql_real_query(&dbh->handle, sql->str, sql->used)) {
-		ast_log(LOG_WARNING, "MySQL RealTime: Failed to query database: %s\n", mysql_error(&dbh->handle));
+		ast_log(LOG_WARNING, "MySQL RealTime: Failed to insert into database: %s\n", mysql_error(&dbh->handle));
 		release_database(dbh);
 		return -1;
 	}
@@ -743,7 +743,7 @@
 	const char *newparam, *newval;
 
 	if (!(dbh = find_database(database, 1))) {
-		ast_log(LOG_WARNING, "MySQL RealTime: Invalid database specified: '%s'.\n", database);
+		ast_log(LOG_WARNING, "MySQL RealTime: Invalid database specified: '%s' (check res_mysql.conf)\n", database);
 		return -1;
 	}
 
@@ -785,7 +785,7 @@
 
 	/* Execution. */
 	if (mysql_real_query(&dbh->handle, sql->str, sql->used)) {
-		ast_log(LOG_WARNING, "MySQL RealTime: Failed to query database: %s\n", mysql_error(&dbh->handle));
+		ast_log(LOG_WARNING, "MySQL RealTime: Failed to delete from database: %s\n", mysql_error(&dbh->handle));
 		release_database(dbh);
 		return -1;
 	}
@@ -824,7 +824,7 @@
 	}
 
 	if (!(dbh = find_database(database, 0))) {
-		ast_log(LOG_WARNING, "MySQL RealTime: Invalid database specified: '%s'\n", database);
+		ast_log(LOG_WARNING, "MySQL RealTime: Invalid database specified: '%s' (check res_mysql.conf)\n", database);
 		return NULL;
 	}
 




More information about the svn-commits mailing list