mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
sql_print_error cleanup
This commit is contained in:
@ -509,16 +509,16 @@ int ha_myisam::repair(THD* thd, HA_CHECK_OPT *check_opt)
|
|||||||
(uint) (T_RETRY_WITHOUT_QUICK | T_QUICK)))
|
(uint) (T_RETRY_WITHOUT_QUICK | T_QUICK)))
|
||||||
{
|
{
|
||||||
param.testflag&= ~T_RETRY_WITHOUT_QUICK;
|
param.testflag&= ~T_RETRY_WITHOUT_QUICK;
|
||||||
sql_print_error("Note: Retrying repair of: '%s' without quick",
|
sql_print_information("Retrying repair of: '%s' without quick",
|
||||||
table->path);
|
table->path);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
param.testflag&= ~T_QUICK;
|
param.testflag&= ~T_QUICK;
|
||||||
if ((param.testflag & T_REP_BY_SORT))
|
if ((param.testflag & T_REP_BY_SORT))
|
||||||
{
|
{
|
||||||
param.testflag= (param.testflag & ~T_REP_BY_SORT) | T_REP;
|
param.testflag= (param.testflag & ~T_REP_BY_SORT) | T_REP;
|
||||||
sql_print_error("Note: Retrying repair of: '%s' with keycache",
|
sql_print_information("Retrying repair of: '%s' with keycache",
|
||||||
table->path);
|
table->path);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -527,10 +527,10 @@ int ha_myisam::repair(THD* thd, HA_CHECK_OPT *check_opt)
|
|||||||
!(check_opt->flags & T_VERY_SILENT))
|
!(check_opt->flags & T_VERY_SILENT))
|
||||||
{
|
{
|
||||||
char llbuff[22],llbuff2[22];
|
char llbuff[22],llbuff2[22];
|
||||||
sql_print_error("Note: Found %s of %s rows when repairing '%s'",
|
sql_print_information("Found %s of %s rows when repairing '%s'",
|
||||||
llstr(file->state->records, llbuff),
|
llstr(file->state->records, llbuff),
|
||||||
llstr(start_records, llbuff2),
|
llstr(start_records, llbuff2),
|
||||||
table->path);
|
table->path);
|
||||||
}
|
}
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
@ -1034,7 +1034,7 @@ bool ha_myisam::check_and_repair(THD *thd)
|
|||||||
// Don't use quick if deleted rows
|
// Don't use quick if deleted rows
|
||||||
if (!file->state->del && (myisam_recover_options & HA_RECOVER_QUICK))
|
if (!file->state->del && (myisam_recover_options & HA_RECOVER_QUICK))
|
||||||
check_opt.flags|=T_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= thd->query;
|
||||||
old_query_length= thd->query_length;
|
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))
|
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=
|
check_opt.flags=
|
||||||
((myisam_recover_options & HA_RECOVER_BACKUP ? T_BACKUP_DATA : 0) |
|
((myisam_recover_options & HA_RECOVER_BACKUP ? T_BACKUP_DATA : 0) |
|
||||||
(marked_crashed ? 0 : T_QUICK) |
|
(marked_crashed ? 0 : T_QUICK) |
|
||||||
|
@ -558,7 +558,7 @@ int ha_commit_trans(THD *thd, THD_TRANS* trans)
|
|||||||
query_cache.invalidate(thd->transaction.changed_tables);
|
query_cache.invalidate(thd->transaction.changed_tables);
|
||||||
#endif /*HAVE_QUERY_CACHE*/
|
#endif /*HAVE_QUERY_CACHE*/
|
||||||
if (error && trans == &thd->transaction.all && mysql_bin_log.is_open())
|
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;
|
thd->variables.tx_isolation=thd->session_tx_isolation;
|
||||||
if (operation_done)
|
if (operation_done)
|
||||||
{
|
{
|
||||||
|
@ -2193,7 +2193,7 @@ void SEL_ARG::test_use_count(SEL_ARG *root)
|
|||||||
uint e_count=0;
|
uint e_count=0;
|
||||||
if (this == root && use_count != 1)
|
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;
|
return;
|
||||||
}
|
}
|
||||||
if (this->type != SEL_ARG::KEY_RANGE)
|
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);
|
ulong count=count_key_part_usage(root,pos->next_key_part);
|
||||||
if (count > pos->next_key_part->use_count)
|
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);
|
pos,pos->next_key_part->use_count,count);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -2214,7 +2214,7 @@ void SEL_ARG::test_use_count(SEL_ARG *root)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (e_count != elements)
|
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);
|
e_count, elements, (gptr) this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1202,7 +1202,7 @@ slaves can't replicate a 5.0 or newer master.";
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
mi->clock_diff_with_master= 0; /* The "most sensible" value */
|
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");
|
do not trust column Seconds_Behind_Master of SHOW SLAVE STATUS");
|
||||||
}
|
}
|
||||||
if (master_res)
|
if (master_res)
|
||||||
|
@ -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);
|
host.sort= get_sort(2,host.host.hostname,host.db);
|
||||||
if (check_no_resolve && hostname_requires_resolving(host.host.hostname))
|
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.",
|
"ignored in --skip-name-resolve mode.",
|
||||||
host.host.hostname, host.db, host.host.hostname);
|
host.host.hostname, host.db, host.host.hostname);
|
||||||
continue;
|
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]);
|
user.user= get_field(&mem, table->field[1]);
|
||||||
if (check_no_resolve && hostname_requires_resolving(user.host.hostname))
|
if (check_no_resolve && hostname_requires_resolving(user.host.hostname))
|
||||||
{
|
{
|
||||||
sql_print_error("Warning: 'user' entry '%s@%s' "
|
sql_print_warning("'user' entry '%s@%s' "
|
||||||
"ignored in --skip-name-resolve mode.",
|
"ignored in --skip-name-resolve mode.",
|
||||||
user.user, user.host.hostname, user.host.hostname);
|
user.user, user.host.hostname, user.host.hostname);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -284,16 +284,16 @@ my_bool acl_init(THD *org_thd, bool dont_read_acl_tables)
|
|||||||
{
|
{
|
||||||
switch (password_len) {
|
switch (password_len) {
|
||||||
case 45: /* 4.1: to be removed */
|
case 45: /* 4.1: to be removed */
|
||||||
sql_print_error("Found 4.1 style password for user '%s@%s'. "
|
sql_print_warning("Found 4.1 style password for user '%s@%s'. "
|
||||||
"Ignoring user. "
|
"Ignoring user. "
|
||||||
"You should change password for this user.",
|
"You should change password for this user.",
|
||||||
user.user ? user.user : "",
|
user.user ? user.user : "",
|
||||||
user.host.hostname ? user.host.hostname : "");
|
user.host.hostname ? user.host.hostname : "");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
sql_print_error("Found invalid password for user: '%s@%s'; "
|
sql_print_warning("Found invalid password for user: '%s@%s'; "
|
||||||
"Ignoring user", user.user ? user.user : "",
|
"Ignoring user", user.user ? user.user : "",
|
||||||
user.host.hostname ? user.host.hostname : "");
|
user.host.hostname ? user.host.hostname : "");
|
||||||
break;
|
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]);
|
db.db=get_field(&mem, table->field[1]);
|
||||||
if (!db.db)
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
db.user=get_field(&mem, table->field[2]);
|
db.user=get_field(&mem, table->field[2]);
|
||||||
if (check_no_resolve && hostname_requires_resolving(db.host.hostname))
|
if (check_no_resolve && hostname_requires_resolving(db.host.hostname))
|
||||||
{
|
{
|
||||||
sql_print_error("Warning: 'db' entry '%s %s@%s' "
|
sql_print_warning("'db' entry '%s %s@%s' "
|
||||||
"ignored in --skip-name-resolve mode.",
|
"ignored in --skip-name-resolve mode.",
|
||||||
db.db, db.user, db.host.hostname, db.host.hostname);
|
db.db, db.user, db.host.hostname, db.host.hostname);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
db.access=get_access(table,3);
|
db.access=get_access(table,3);
|
||||||
@ -733,9 +733,9 @@ int acl_getroot(THD *thd, USER_RESOURCES *mqh,
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (global_system_variables.log_warnings)
|
if (global_system_variables.log_warnings)
|
||||||
sql_print_error("X509 ciphers mismatch: should be '%s' but is '%s'",
|
sql_print_information("X509 ciphers mismatch: should be '%s' but is '%s'",
|
||||||
acl_user->ssl_cipher,
|
acl_user->ssl_cipher,
|
||||||
SSL_get_cipher(ssl));
|
SSL_get_cipher(ssl));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -757,8 +757,8 @@ int acl_getroot(THD *thd, USER_RESOURCES *mqh,
|
|||||||
if (strcmp(acl_user->x509_issuer, ptr))
|
if (strcmp(acl_user->x509_issuer, ptr))
|
||||||
{
|
{
|
||||||
if (global_system_variables.log_warnings)
|
if (global_system_variables.log_warnings)
|
||||||
sql_print_error("X509 issuer mismatch: should be '%s' "
|
sql_print_information("X509 issuer mismatch: should be '%s' "
|
||||||
"but is '%s'", acl_user->x509_issuer, ptr);
|
"but is '%s'", acl_user->x509_issuer, ptr);
|
||||||
free(ptr);
|
free(ptr);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -775,7 +775,7 @@ int acl_getroot(THD *thd, USER_RESOURCES *mqh,
|
|||||||
if (strcmp(acl_user->x509_subject,ptr))
|
if (strcmp(acl_user->x509_subject,ptr))
|
||||||
{
|
{
|
||||||
if (global_system_variables.log_warnings)
|
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);
|
acl_user->x509_subject, ptr);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -2610,10 +2610,10 @@ my_bool grant_init(THD *org_thd)
|
|||||||
{
|
{
|
||||||
if (hostname_requires_resolving(mem_check->host))
|
if (hostname_requires_resolving(mem_check->host))
|
||||||
{
|
{
|
||||||
sql_print_error("Warning: 'tables_priv' entry '%s %s@%s' "
|
sql_print_warning("'tables_priv' entry '%s %s@%s' "
|
||||||
"ignored in --skip-name-resolve mode.",
|
"ignored in --skip-name-resolve mode.",
|
||||||
mem_check->tname, mem_check->user,
|
mem_check->tname, mem_check->user,
|
||||||
mem_check->host, mem_check->host);
|
mem_check->host, mem_check->host);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3680,12 +3680,6 @@ int mysql_revoke_all(THD *thd, List <LEX_USER> &list)
|
|||||||
rw_unlock(&LOCK_grant);
|
rw_unlock(&LOCK_grant);
|
||||||
close_thread_tables(thd);
|
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)
|
if (result)
|
||||||
my_error(ER_REVOKE_GRANTS, MYF(0));
|
my_error(ER_REVOKE_GRANTS, MYF(0));
|
||||||
|
|
||||||
|
@ -1384,7 +1384,7 @@ static int open_unireg_entry(THD *thd, TABLE *entry, const char *db,
|
|||||||
/* Give right error message */
|
/* Give right error message */
|
||||||
thd->clear_error();
|
thd->clear_error();
|
||||||
my_error(ER_NOT_KEYFILE, MYF(0), name, my_errno);
|
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)
|
if (entry->file)
|
||||||
closefrm(entry);
|
closefrm(entry);
|
||||||
error=1;
|
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
|
DBA on top of warning the client (which will automatically be done
|
||||||
because of MYF(MY_WME) in my_malloc() above).
|
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);
|
memory to write 'DELETE FROM `%s`.`%s`' to the binary log",db,name);
|
||||||
if (entry->file)
|
if (entry->file)
|
||||||
closefrm(entry);
|
closefrm(entry);
|
||||||
@ -1820,8 +1820,8 @@ bool rm_temporary_table(enum db_type base, char *path)
|
|||||||
if (file && file->delete_table(path))
|
if (file && file->delete_table(path))
|
||||||
{
|
{
|
||||||
error=1;
|
error=1;
|
||||||
sql_print_error("Warning: Could not remove tmp table: '%s', error: %d",
|
sql_print_warning("Could not remove tmp table: '%s', error: %d",
|
||||||
path, my_errno);
|
path, my_errno);
|
||||||
}
|
}
|
||||||
delete file;
|
delete file;
|
||||||
DBUG_RETURN(error);
|
DBUG_RETURN(error);
|
||||||
|
@ -1022,12 +1022,12 @@ pthread_handler_decl(handle_one_connection,arg)
|
|||||||
if (net->error && net->vio != 0 && net->report_error)
|
if (net->error && net->vio != 0 && net->report_error)
|
||||||
{
|
{
|
||||||
if (!thd->killed && thd->variables.log_warnings > 1)
|
if (!thd->killed && thd->variables.log_warnings > 1)
|
||||||
sql_print_error(ER(ER_NEW_ABORTING_CONNECTION),
|
sql_print_warning(ER(ER_NEW_ABORTING_CONNECTION),
|
||||||
thd->thread_id,(thd->db ? thd->db : "unconnected"),
|
thd->thread_id,(thd->db ? thd->db : "unconnected"),
|
||||||
thd->user ? thd->user : "unauthenticated",
|
thd->user ? thd->user : "unauthenticated",
|
||||||
thd->host_or_ip,
|
thd->host_or_ip,
|
||||||
(net->last_errno ? ER(net->last_errno) :
|
(net->last_errno ? ER(net->last_errno) :
|
||||||
ER(ER_UNKNOWN_ERROR)));
|
ER(ER_UNKNOWN_ERROR)));
|
||||||
send_error(thd,net->last_errno,NullS);
|
send_error(thd,net->last_errno,NullS);
|
||||||
statistic_increment(aborted_threads,&LOCK_status);
|
statistic_increment(aborted_threads,&LOCK_status);
|
||||||
}
|
}
|
||||||
|
@ -3250,8 +3250,8 @@ int mysql_alter_table(THD *thd,char *new_db, char *new_name,
|
|||||||
my_free((char*) table, MYF(0));
|
my_free((char*) table, MYF(0));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
sql_print_error("Warning: Could not open BDB table %s.%s after rename\n",
|
sql_print_warning("Could not open BDB table %s.%s after rename\n",
|
||||||
new_db,table_name);
|
new_db,table_name);
|
||||||
(void) berkeley_flush_logs();
|
(void) berkeley_flush_logs();
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -184,8 +184,7 @@ void udf_init()
|
|||||||
if (!(dl = dlopen(tmp->dl, RTLD_NOW)))
|
if (!(dl = dlopen(tmp->dl, RTLD_NOW)))
|
||||||
{
|
{
|
||||||
/* Print warning to log */
|
/* Print warning to log */
|
||||||
sql_print_error(ER(ER_CANT_OPEN_LIBRARY),
|
sql_print_error(ER(ER_CANT_OPEN_LIBRARY), tmp->dl,errno,dlerror());
|
||||||
tmp->dl,errno,dlerror());
|
|
||||||
/* Keep the udf in the hash so that we can remove it later */
|
/* Keep the udf in the hash so that we can remove it later */
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user