[svn-commits] tilghman: branch 1.6.2 r1017 - /branches/1.6.2/res/res_config_mysql.c

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


Author: tilghman
Date: Tue Aug 18 14:47:13 2009
New Revision: 1017

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

Modified:
    branches/1.6.2/res/res_config_mysql.c

Modified: branches/1.6.2/res/res_config_mysql.c
URL: http://svn.asterisk.org/svn-view/asterisk-addons/branches/1.6.2/res/res_config_mysql.c?view=diff&rev=1017&r1=1016&r2=1017
==============================================================================
--- branches/1.6.2/res/res_config_mysql.c (original)
+++ branches/1.6.2/res/res_config_mysql.c Tue Aug 18 14:47:13 2009
@@ -223,7 +223,7 @@
 	}
 
 	if (mysql_real_query(&dbh->handle, ast_str_buffer(sql), ast_str_strlen(sql))) {
-		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;
@@ -253,7 +253,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);
@@ -322,7 +322,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;
 	}
 
@@ -428,7 +428,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;
 	}
 
@@ -547,7 +547,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;
 	}
 		
@@ -564,7 +564,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;
@@ -574,7 +574,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;
@@ -582,7 +582,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;
@@ -632,7 +632,7 @@
 
 	/* Execution. */
 	if (mysql_real_query(&dbh->handle, ast_str_buffer(sql), ast_str_strlen(sql))) {
-		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;
@@ -752,7 +752,7 @@
 
 	/* Execution. */
 	if (mysql_real_query(&dbh->handle, ast_str_buffer(sql), ast_str_strlen(sql))) {
-		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;
@@ -783,7 +783,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;
 	}
 
@@ -831,7 +831,7 @@
 
 	/* Execution. */
 	if (mysql_real_query(&dbh->handle, ast_str_buffer(sql), ast_str_strlen(sql))) {
-		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;
 	}
@@ -860,7 +860,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;
 	}
 
@@ -900,7 +900,7 @@
 
 	/* Execution. */
 	if (mysql_real_query(&dbh->handle, ast_str_buffer(sql), ast_str_strlen(sql))) {
-		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;
 	}
@@ -939,7 +939,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