summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorunknown <serg@serg.mylan>2004-09-04 20:17:09 +0200
committerunknown <serg@serg.mylan>2004-09-04 20:17:09 +0200
commitdf8a43b8b2f51901fc35cd5dbd047e09941eeae3 (patch)
tree6c5ba5b242257855157cdf52a44d6a7e88c3884a /sql
parentc0c7e8f56454f6624b0f32a556f71fc12b7f210b (diff)
downloadmariadb-git-df8a43b8b2f51901fc35cd5dbd047e09941eeae3.tar.gz
sql_print_error cleanup
Diffstat (limited to 'sql')
-rw-r--r--sql/ha_myisam.cc20
-rw-r--r--sql/handler.cc2
-rw-r--r--sql/opt_range.cc6
-rw-r--r--sql/slave.cc2
-rw-r--r--sql/sql_acl.cc56
-rw-r--r--sql/sql_base.cc8
-rw-r--r--sql/sql_parse.cc12
-rw-r--r--sql/sql_table.cc4
-rw-r--r--sql/sql_udf.cc3
9 files changed, 53 insertions, 60 deletions
diff --git a/sql/ha_myisam.cc b/sql/ha_myisam.cc
index 3d2d25b3e7d..95a294764d3 100644
--- a/sql/ha_myisam.cc
+++ b/sql/ha_myisam.cc
@@ -509,16 +509,16 @@ int ha_myisam::repair(THD* thd, HA_CHECK_OPT *check_opt)
(uint) (T_RETRY_WITHOUT_QUICK | T_QUICK)))
{
param.testflag&= ~T_RETRY_WITHOUT_QUICK;
- sql_print_error("Note: Retrying repair of: '%s' without quick",
- table->path);
+ sql_print_information("Retrying repair of: '%s' without quick",
+ table->path);
continue;
}
param.testflag&= ~T_QUICK;
if ((param.testflag & T_REP_BY_SORT))
{
param.testflag= (param.testflag & ~T_REP_BY_SORT) | T_REP;
- sql_print_error("Note: Retrying repair of: '%s' with keycache",
- table->path);
+ sql_print_information("Retrying repair of: '%s' with keycache",
+ table->path);
continue;
}
break;
@@ -527,10 +527,10 @@ int ha_myisam::repair(THD* thd, HA_CHECK_OPT *check_opt)
!(check_opt->flags & T_VERY_SILENT))
{
char llbuff[22],llbuff2[22];
- sql_print_error("Note: Found %s of %s rows when repairing '%s'",
- llstr(file->state->records, llbuff),
- llstr(start_records, llbuff2),
- table->path);
+ sql_print_information("Found %s of %s rows when repairing '%s'",
+ llstr(file->state->records, llbuff),
+ llstr(start_records, llbuff2),
+ table->path);
}
return error;
}
@@ -1034,7 +1034,7 @@ bool ha_myisam::check_and_repair(THD *thd)
// Don't use quick if deleted rows
if (!file->state->del && (myisam_recover_options & HA_RECOVER_QUICK))
check_opt.flags|=T_QUICK;
- sql_print_error("Warning: Checking table: '%s'",table->path);
+ sql_print_warning("Checking table: '%s'",table->path);
old_query= thd->query;
old_query_length= thd->query_length;
@@ -1045,7 +1045,7 @@ bool ha_myisam::check_and_repair(THD *thd)
if ((marked_crashed= mi_is_crashed(file)) || check(thd, &check_opt))
{
- sql_print_error("Warning: Recovering table: '%s'",table->path);
+ sql_print_warning("Recovering table: '%s'",table->path);
check_opt.flags=
((myisam_recover_options & HA_RECOVER_BACKUP ? T_BACKUP_DATA : 0) |
(marked_crashed ? 0 : T_QUICK) |
diff --git a/sql/handler.cc b/sql/handler.cc
index 15f30b25eb8..b7634b3cf33 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -558,7 +558,7 @@ int ha_commit_trans(THD *thd, THD_TRANS* trans)
query_cache.invalidate(thd->transaction.changed_tables);
#endif /*HAVE_QUERY_CACHE*/
if (error && trans == &thd->transaction.all && mysql_bin_log.is_open())
- sql_print_error("Error: Got error during commit; Binlog is not up to date!");
+ sql_print_error("Got error during commit; Binlog is not up to date!");
thd->variables.tx_isolation=thd->session_tx_isolation;
if (operation_done)
{
diff --git a/sql/opt_range.cc b/sql/opt_range.cc
index f11ed31950a..27e8e9c11e7 100644
--- a/sql/opt_range.cc
+++ b/sql/opt_range.cc
@@ -2193,7 +2193,7 @@ void SEL_ARG::test_use_count(SEL_ARG *root)
uint e_count=0;
if (this == root && use_count != 1)
{
- sql_print_error("Note: Use_count: Wrong count %lu for root",use_count);
+ sql_print_information("Use_count: Wrong count %lu for root",use_count);
return;
}
if (this->type != SEL_ARG::KEY_RANGE)
@@ -2206,7 +2206,7 @@ void SEL_ARG::test_use_count(SEL_ARG *root)
ulong count=count_key_part_usage(root,pos->next_key_part);
if (count > pos->next_key_part->use_count)
{
- sql_print_error("Note: Use_count: Wrong count for key at %lx, %lu should be %lu",
+ sql_print_information("Use_count: Wrong count for key at %lx, %lu should be %lu",
pos,pos->next_key_part->use_count,count);
return;
}
@@ -2214,7 +2214,7 @@ void SEL_ARG::test_use_count(SEL_ARG *root)
}
}
if (e_count != elements)
- sql_print_error("Warning: Wrong use count: %u (should be %u) for tree at %lx",
+ sql_print_warning("Wrong use count: %u (should be %u) for tree at %lx",
e_count, elements, (gptr) this);
}
diff --git a/sql/slave.cc b/sql/slave.cc
index cb37a798037..96b484a3965 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -1202,7 +1202,7 @@ slaves can't replicate a 5.0 or newer master.";
else
{
mi->clock_diff_with_master= 0; /* The "most sensible" value */
- sql_print_error("Warning: \"SELECT UNIX_TIMESTAMP()\" failed on master, \
+ sql_print_warning("\"SELECT UNIX_TIMESTAMP()\" failed on master, \
do not trust column Seconds_Behind_Master of SHOW SLAVE STATUS");
}
if (master_res)
diff --git a/sql/sql_acl.cc b/sql/sql_acl.cc
index 9c6853187f6..fc68e26c21d 100644
--- a/sql/sql_acl.cc
+++ b/sql/sql_acl.cc
@@ -203,7 +203,7 @@ my_bool acl_init(THD *org_thd, bool dont_read_acl_tables)
host.sort= get_sort(2,host.host.hostname,host.db);
if (check_no_resolve && hostname_requires_resolving(host.host.hostname))
{
- sql_print_error("Warning: 'host' entry '%s|%s' "
+ sql_print_warning("'host' entry '%s|%s' "
"ignored in --skip-name-resolve mode.",
host.host.hostname, host.db, host.host.hostname);
continue;
@@ -271,8 +271,8 @@ my_bool acl_init(THD *org_thd, bool dont_read_acl_tables)
user.user= get_field(&mem, table->field[1]);
if (check_no_resolve && hostname_requires_resolving(user.host.hostname))
{
- sql_print_error("Warning: 'user' entry '%s@%s' "
- "ignored in --skip-name-resolve mode.",
+ sql_print_warning("'user' entry '%s@%s' "
+ "ignored in --skip-name-resolve mode.",
user.user, user.host.hostname, user.host.hostname);
continue;
}
@@ -284,16 +284,16 @@ my_bool acl_init(THD *org_thd, bool dont_read_acl_tables)
{
switch (password_len) {
case 45: /* 4.1: to be removed */
- sql_print_error("Found 4.1 style password for user '%s@%s'. "
- "Ignoring user. "
- "You should change password for this user.",
- user.user ? user.user : "",
- user.host.hostname ? user.host.hostname : "");
+ sql_print_warning("Found 4.1 style password for user '%s@%s'. "
+ "Ignoring user. "
+ "You should change password for this user.",
+ user.user ? user.user : "",
+ user.host.hostname ? user.host.hostname : "");
break;
default:
- sql_print_error("Found invalid password for user: '%s@%s'; "
- "Ignoring user", user.user ? user.user : "",
- user.host.hostname ? user.host.hostname : "");
+ sql_print_warning("Found invalid password for user: '%s@%s'; "
+ "Ignoring user", user.user ? user.user : "",
+ user.host.hostname ? user.host.hostname : "");
break;
}
}
@@ -368,15 +368,15 @@ my_bool acl_init(THD *org_thd, bool dont_read_acl_tables)
db.db=get_field(&mem, table->field[1]);
if (!db.db)
{
- sql_print_error("Found an entry in the 'db' table with empty database name; Skipped");
+ sql_print_warning("Found an entry in the 'db' table with empty database name; Skipped");
continue;
}
db.user=get_field(&mem, table->field[2]);
if (check_no_resolve && hostname_requires_resolving(db.host.hostname))
{
- sql_print_error("Warning: 'db' entry '%s %s@%s' "
- "ignored in --skip-name-resolve mode.",
- db.db, db.user, db.host.hostname, db.host.hostname);
+ sql_print_warning("'db' entry '%s %s@%s' "
+ "ignored in --skip-name-resolve mode.",
+ db.db, db.user, db.host.hostname, db.host.hostname);
continue;
}
db.access=get_access(table,3);
@@ -733,9 +733,9 @@ int acl_getroot(THD *thd, USER_RESOURCES *mqh,
else
{
if (global_system_variables.log_warnings)
- sql_print_error("X509 ciphers mismatch: should be '%s' but is '%s'",
- acl_user->ssl_cipher,
- SSL_get_cipher(ssl));
+ sql_print_information("X509 ciphers mismatch: should be '%s' but is '%s'",
+ acl_user->ssl_cipher,
+ SSL_get_cipher(ssl));
break;
}
}
@@ -757,8 +757,8 @@ int acl_getroot(THD *thd, USER_RESOURCES *mqh,
if (strcmp(acl_user->x509_issuer, ptr))
{
if (global_system_variables.log_warnings)
- sql_print_error("X509 issuer mismatch: should be '%s' "
- "but is '%s'", acl_user->x509_issuer, ptr);
+ sql_print_information("X509 issuer mismatch: should be '%s' "
+ "but is '%s'", acl_user->x509_issuer, ptr);
free(ptr);
break;
}
@@ -775,7 +775,7 @@ int acl_getroot(THD *thd, USER_RESOURCES *mqh,
if (strcmp(acl_user->x509_subject,ptr))
{
if (global_system_variables.log_warnings)
- sql_print_error("X509 subject mismatch: '%s' vs '%s'",
+ sql_print_information("X509 subject mismatch: '%s' vs '%s'",
acl_user->x509_subject, ptr);
}
else
@@ -2610,10 +2610,10 @@ my_bool grant_init(THD *org_thd)
{
if (hostname_requires_resolving(mem_check->host))
{
- sql_print_error("Warning: 'tables_priv' entry '%s %s@%s' "
- "ignored in --skip-name-resolve mode.",
- mem_check->tname, mem_check->user,
- mem_check->host, mem_check->host);
+ sql_print_warning("'tables_priv' entry '%s %s@%s' "
+ "ignored in --skip-name-resolve mode.",
+ mem_check->tname, mem_check->user,
+ mem_check->host, mem_check->host);
continue;
}
}
@@ -3680,12 +3680,6 @@ int mysql_revoke_all(THD *thd, List <LEX_USER> &list)
rw_unlock(&LOCK_grant);
close_thread_tables(thd);
- /* XXX this should not be necessary. The error message is already printed
- by replace_xxx_table. my_error() should be use above instead of
- sql_print_error(), and print ER_NONEXISTING_GRANT - as other grant
- commands do */
- /* when this code is deleted, the error slot (error 1268) can be reused,
- as this error code was not present in any MySQL release */
if (result)
my_error(ER_REVOKE_GRANTS, MYF(0));
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index ac5008717e6..30f97cf20a9 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -1384,7 +1384,7 @@ static int open_unireg_entry(THD *thd, TABLE *entry, const char *db,
/* Give right error message */
thd->clear_error();
my_error(ER_NOT_KEYFILE, MYF(0), name, my_errno);
- sql_print_error("Error: Couldn't repair table: %s.%s",db,name);
+ sql_print_error("Couldn't repair table: %s.%s",db,name);
if (entry->file)
closefrm(entry);
error=1;
@@ -1424,7 +1424,7 @@ static int open_unireg_entry(THD *thd, TABLE *entry, const char *db,
DBA on top of warning the client (which will automatically be done
because of MYF(MY_WME) in my_malloc() above).
*/
- sql_print_error("Error: when opening HEAP table, could not allocate \
+ sql_print_error("When opening HEAP table, could not allocate \
memory to write 'DELETE FROM `%s`.`%s`' to the binary log",db,name);
if (entry->file)
closefrm(entry);
@@ -1820,8 +1820,8 @@ bool rm_temporary_table(enum db_type base, char *path)
if (file && file->delete_table(path))
{
error=1;
- sql_print_error("Warning: Could not remove tmp table: '%s', error: %d",
- path, my_errno);
+ sql_print_warning("Could not remove tmp table: '%s', error: %d",
+ path, my_errno);
}
delete file;
DBUG_RETURN(error);
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 79a011b9501..a90a58ddfe0 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -1022,12 +1022,12 @@ pthread_handler_decl(handle_one_connection,arg)
if (net->error && net->vio != 0 && net->report_error)
{
if (!thd->killed && thd->variables.log_warnings > 1)
- sql_print_error(ER(ER_NEW_ABORTING_CONNECTION),
- thd->thread_id,(thd->db ? thd->db : "unconnected"),
- thd->user ? thd->user : "unauthenticated",
- thd->host_or_ip,
- (net->last_errno ? ER(net->last_errno) :
- ER(ER_UNKNOWN_ERROR)));
+ sql_print_warning(ER(ER_NEW_ABORTING_CONNECTION),
+ thd->thread_id,(thd->db ? thd->db : "unconnected"),
+ thd->user ? thd->user : "unauthenticated",
+ thd->host_or_ip,
+ (net->last_errno ? ER(net->last_errno) :
+ ER(ER_UNKNOWN_ERROR)));
send_error(thd,net->last_errno,NullS);
statistic_increment(aborted_threads,&LOCK_status);
}
diff --git a/sql/sql_table.cc b/sql/sql_table.cc
index 58e3bc1d9ac..a1760261f94 100644
--- a/sql/sql_table.cc
+++ b/sql/sql_table.cc
@@ -3250,8 +3250,8 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
my_free((char*) table, MYF(0));
}
else
- sql_print_error("Warning: Could not open BDB table %s.%s after rename\n",
- new_db,table_name);
+ sql_print_warning("Could not open BDB table %s.%s after rename\n",
+ new_db,table_name);
(void) berkeley_flush_logs();
}
#endif
diff --git a/sql/sql_udf.cc b/sql/sql_udf.cc
index 561f79f9de1..0bb8ac8a28b 100644
--- a/sql/sql_udf.cc
+++ b/sql/sql_udf.cc
@@ -184,8 +184,7 @@ void udf_init()
if (!(dl = dlopen(tmp->dl, RTLD_NOW)))
{
/* Print warning to log */
- sql_print_error(ER(ER_CANT_OPEN_LIBRARY),
- tmp->dl,errno,dlerror());
+ sql_print_error(ER(ER_CANT_OPEN_LIBRARY), tmp->dl,errno,dlerror());
/* Keep the udf in the hash so that we can remove it later */
continue;
}