Merge mysql.com:/home/my/mysql-5.0

into  mysql.com:/home/my/mysql-5.1
This commit is contained in:
monty@nosik.monty.fi 2006-11-22 14:11:36 +02:00
commit 89570bf966
166 changed files with 973 additions and 964 deletions

View File

@ -1252,6 +1252,7 @@ mysql-test/r/*.err
mysql-test/r/*.log mysql-test/r/*.log
mysql-test/r/*.out mysql-test/r/*.out
mysql-test/r/*.reject mysql-test/r/*.reject
mysql-test/r/*.warnings
mysql-test/r/alter_table.err mysql-test/r/alter_table.err
mysql-test/r/archive.err mysql-test/r/archive.err
mysql-test/r/backup.log mysql-test/r/backup.log

View File

@ -1140,7 +1140,7 @@ could be out of memory");
} }
if (len < 8 && net->read_pos[0] == 254) if (len < 8 && net->read_pos[0] == 254)
break; // end of data break; // end of data
DBUG_PRINT("info",( "len= %u, net->read_pos[5] = %d\n", DBUG_PRINT("info",( "len: %lu, net->read_pos[5]: %d\n",
len, net->read_pos[5])); len, net->read_pos[5]));
if (!(ev= Log_event::read_log_event((const char*) net->read_pos + 1 , if (!(ev= Log_event::read_log_event((const char*) net->read_pos + 1 ,
len - 1, &error_msg, len - 1, &error_msg,

View File

@ -30,14 +30,14 @@
** master/autocommit code by Brian Aker <brian@tangent.org> ** master/autocommit code by Brian Aker <brian@tangent.org>
** SSL by ** SSL by
** Andrei Errapart <andreie@no.spam.ee> ** Andrei Errapart <andreie@no.spam.ee>
** µnu Samuel <tonu@please.do.not.remove.this.spam.ee> ** ƒÂµnu Samuel <tonu@please.do.not.remove.this.spam.ee>
** XML by Gary Huntress <ghuntress@mediaone.net> 10/10/01, cleaned up ** XML by Gary Huntress <ghuntress@mediaone.net> 10/10/01, cleaned up
** and adapted to mysqldump 05/11/01 by Jani Tolonen ** and adapted to mysqldump 05/11/01 by Jani Tolonen
** Added --single-transaction option 06/06/2002 by Peter Zaitsev ** Added --single-transaction option 06/06/2002 by Peter Zaitsev
** 10 Jun 2003: SET NAMES and --no-set-names by Alexander Barkov ** 10 Jun 2003: SET NAMES and --no-set-names by Alexander Barkov
*/ */
#define DUMP_VERSION "10.10" #define DUMP_VERSION "10.11"
#include <my_global.h> #include <my_global.h>
#include <my_sys.h> #include <my_sys.h>
@ -103,7 +103,7 @@ static my_bool verbose= 0, opt_no_create_info= 0, opt_no_data= 0,
opt_alltspcs=0; opt_alltspcs=0;
static ulong opt_max_allowed_packet, opt_net_buffer_length; static ulong opt_max_allowed_packet, opt_net_buffer_length;
static MYSQL mysql_connection,*mysql=0; static MYSQL mysql_connection,*mysql=0;
static my_bool insert_pat_inited=0; static my_bool insert_pat_inited= 0, info_flag;
static DYNAMIC_STRING insert_pat; static DYNAMIC_STRING insert_pat;
static char *opt_password=0,*current_user=0, static char *opt_password=0,*current_user=0,
*current_host=0,*path=0,*fields_terminated=0, *current_host=0,*path=0,*fields_terminated=0,
@ -111,6 +111,7 @@ static char *opt_password=0,*current_user=0,
*where=0, *order_by=0, *where=0, *order_by=0,
*opt_compatible_mode_str= 0, *opt_compatible_mode_str= 0,
*err_ptr= 0; *err_ptr= 0;
static char **defaults_argv= 0;
static char compatible_mode_normal_str[255]; static char compatible_mode_normal_str[255];
static ulong opt_compatible_mode= 0; static ulong opt_compatible_mode= 0;
#define MYSQL_OPT_MASTER_DATA_EFFECTIVE_SQL 1 #define MYSQL_OPT_MASTER_DATA_EFFECTIVE_SQL 1
@ -120,7 +121,7 @@ static my_string opt_mysql_unix_port=0;
static int first_error=0; static int first_error=0;
static DYNAMIC_STRING extended_row; static DYNAMIC_STRING extended_row;
#include <sslopt-vars.h> #include <sslopt-vars.h>
FILE *md_result_file; FILE *md_result_file= 0;
#ifdef HAVE_SMEM #ifdef HAVE_SMEM
static char *shared_memory_base_name=0; static char *shared_memory_base_name=0;
#endif #endif
@ -222,6 +223,8 @@ static struct my_option my_long_options[] =
{"debug", '#', "Output debug log", (gptr*) &default_dbug_option, {"debug", '#', "Output debug log", (gptr*) &default_dbug_option,
(gptr*) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0}, (gptr*) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
#endif #endif
{"debug-info", OPT_DEBUG_INFO, "Print some debug info at exit.", (gptr*) &info_flag,
(gptr*) &info_flag, 0, GET_BOOL, NO_ARG, 0, 0, 0, 0, 0, 0},
{"default-character-set", OPT_DEFAULT_CHARSET, {"default-character-set", OPT_DEFAULT_CHARSET,
"Set the default character set.", (gptr*) &default_charset, "Set the default character set.", (gptr*) &default_charset,
(gptr*) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0}, (gptr*) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
@ -641,14 +644,6 @@ byte* get_table_key(const char *entry, uint *length,
} }
void init_table_rule_hash(HASH* h)
{
if (hash_init(h, charset_info, 16, 0, 0,
(hash_get_key) get_table_key,
(hash_free_key) free_table_ent, 0))
exit(EX_EOM);
}
static my_bool static my_bool
get_one_option(int optid, const struct my_option *opt __attribute__((unused)), get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
char *argument) char *argument)
@ -691,6 +686,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
break; break;
case '#': case '#':
DBUG_PUSH(argument ? argument : default_dbug_option); DBUG_PUSH(argument ? argument : default_dbug_option);
info_flag= 1;
break; break;
#include <sslopt-case.h> #include <sslopt-case.h>
case 'V': print_version(); exit(0); case 'V': print_version(); exit(0);
@ -731,9 +727,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
fprintf(stderr, "Illegal use of option --ignore-table=<database>.<table>\n"); fprintf(stderr, "Illegal use of option --ignore-table=<database>.<table>\n");
exit(1); exit(1);
} }
if (!hash_inited(&ignore_table))
init_table_rule_hash(&ignore_table);
if (my_hash_insert(&ignore_table, (byte*)my_strdup(argument, MYF(0)))) if (my_hash_insert(&ignore_table, (byte*)my_strdup(argument, MYF(0))))
exit(EX_EOM); exit(EX_EOM);
break; break;
@ -809,9 +802,21 @@ static int get_options(int *argc, char ***argv)
md_result_file= stdout; md_result_file= stdout;
load_defaults("my",load_default_groups,argc,argv); load_defaults("my",load_default_groups,argc,argv);
defaults_argv= *argv;
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option))) if (hash_init(&ignore_table, charset_info, 16, 0, 0,
exit(ho_error); (hash_get_key) get_table_key,
(hash_free_key) free_table_ent, 0))
return(EX_EOM);
/* Don't copy cluster internal log tables */
if (my_hash_insert(&ignore_table,
(byte*) my_strdup("mysql.apply_status", MYF(MY_WME))) ||
my_hash_insert(&ignore_table,
(byte*) my_strdup("mysql.schema", MYF(MY_WME))))
return(EX_EOM);
if ((ho_error= handle_options(argc, argv, my_long_options, get_one_option)))
return(ho_error);
*mysql_params->p_max_allowed_packet= opt_max_allowed_packet; *mysql_params->p_max_allowed_packet= opt_max_allowed_packet;
*mysql_params->p_net_buffer_length= opt_net_buffer_length; *mysql_params->p_net_buffer_length= opt_net_buffer_length;
@ -823,7 +828,7 @@ static int get_options(int *argc, char ***argv)
{ {
fprintf(stderr, fprintf(stderr,
"%s: You must use option --tab with --fields-...\n", my_progname); "%s: You must use option --tab with --fields-...\n", my_progname);
return(1); return(EX_USAGE);
} }
/* Ensure consistency of the set of binlog & locking options */ /* Ensure consistency of the set of binlog & locking options */
@ -833,7 +838,7 @@ static int get_options(int *argc, char ***argv)
{ {
fprintf(stderr, "%s: You can't use --single-transaction and " fprintf(stderr, "%s: You can't use --single-transaction and "
"--lock-all-tables at the same time.\n", my_progname); "--lock-all-tables at the same time.\n", my_progname);
return(1); return(EX_USAGE);
} }
if (opt_master_data) if (opt_master_data)
opt_lock_all_tables= !opt_single_transaction; opt_lock_all_tables= !opt_single_transaction;
@ -842,14 +847,14 @@ static int get_options(int *argc, char ***argv)
if (enclosed && opt_enclosed) if (enclosed && opt_enclosed)
{ {
fprintf(stderr, "%s: You can't use ..enclosed.. and ..optionally-enclosed.. at the same time.\n", my_progname); fprintf(stderr, "%s: You can't use ..enclosed.. and ..optionally-enclosed.. at the same time.\n", my_progname);
return(1); return(EX_USAGE);
} }
if ((opt_databases || opt_alldbs) && path) if ((opt_databases || opt_alldbs) && path)
{ {
fprintf(stderr, fprintf(stderr,
"%s: --databases or --all-databases can't be used with --tab.\n", "%s: --databases or --all-databases can't be used with --tab.\n",
my_progname); my_progname);
return(1); return(EX_USAGE);
} }
if (strcmp(default_charset, charset_info->csname) && if (strcmp(default_charset, charset_info->csname) &&
!(charset_info= get_charset_by_csname(default_charset, !(charset_info= get_charset_by_csname(default_charset,
@ -858,7 +863,7 @@ static int get_options(int *argc, char ***argv)
if ((*argc < 1 && !opt_alldbs) || (*argc > 0 && opt_alldbs)) if ((*argc < 1 && !opt_alldbs) || (*argc > 0 && opt_alldbs))
{ {
short_usage(); short_usage();
return 1; return EX_USAGE;
} }
if (tty_password) if (tty_password)
opt_password=get_tty_password(NullS); opt_password=get_tty_password(NullS);
@ -933,6 +938,23 @@ static FILE* open_sql_file_for_table(const char* table)
} }
static void free_resources()
{
if (md_result_file && md_result_file != stdout)
my_fclose(md_result_file, MYF(0));
my_free(opt_password, MYF(MY_ALLOW_ZERO_PTR));
if (hash_inited(&ignore_table))
hash_free(&ignore_table);
if (extended_insert)
dynstr_free(&extended_row);
if (insert_pat_inited)
dynstr_free(&insert_pat);
if (defaults_argv)
free_defaults(defaults_argv);
my_end(info_flag ? MY_CHECK_ERROR : 0);
}
static void safe_exit(int error) static void safe_exit(int error)
{ {
if (!first_error) if (!first_error)
@ -941,18 +963,19 @@ static void safe_exit(int error)
return; return;
if (mysql) if (mysql)
mysql_close(mysql); mysql_close(mysql);
free_resources();
exit(error); exit(error);
} }
/* safe_exit */
/* /*
** dbConnect -- connects to the host and selects DB. db_connect -- connects to the host and selects DB.
*/ */
static int dbConnect(char *host, char *user,char *passwd)
static int connect_to_db(char *host, char *user,char *passwd)
{ {
char buff[20+FN_REFLEN]; char buff[20+FN_REFLEN];
DBUG_ENTER("dbConnect"); DBUG_ENTER("connect_to_db");
verbose_msg("-- Connecting to %s...\n", host ? host : "localhost"); verbose_msg("-- Connecting to %s...\n", host ? host : "localhost");
mysql_init(&mysql_connection); mysql_init(&mysql_connection);
@ -977,7 +1000,7 @@ static int dbConnect(char *host, char *user,char *passwd)
0))) 0)))
{ {
DB_error(&mysql_connection, "when trying to connect"); DB_error(&mysql_connection, "when trying to connect");
return 1; DBUG_RETURN(1);
} }
/* /*
Don't dump SET NAMES with a pre-4.1 server (bug#7997). Don't dump SET NAMES with a pre-4.1 server (bug#7997).
@ -994,7 +1017,7 @@ static int dbConnect(char *host, char *user,char *passwd)
if (mysql_query_with_error_report(mysql, 0, buff)) if (mysql_query_with_error_report(mysql, 0, buff))
{ {
safe_exit(EX_MYSQLERR); safe_exit(EX_MYSQLERR);
return 1; DBUG_RETURN(1);
} }
/* /*
set time_zone to UTC to allow dumping date types between servers with set time_zone to UTC to allow dumping date types between servers with
@ -1006,11 +1029,11 @@ static int dbConnect(char *host, char *user,char *passwd)
if (mysql_query_with_error_report(mysql, 0, buff)) if (mysql_query_with_error_report(mysql, 0, buff))
{ {
safe_exit(EX_MYSQLERR); safe_exit(EX_MYSQLERR);
return 1; DBUG_RETURN(1);
} }
} }
return 0; DBUG_RETURN(0);
} /* dbConnect */ } /* connect_to_db */
/* /*
@ -1659,7 +1682,11 @@ static uint get_table_structure(char *table, char *db, char *table_type,
{ {
complete_insert= opt_complete_insert; complete_insert= opt_complete_insert;
if (!insert_pat_inited) if (!insert_pat_inited)
insert_pat_inited= init_dynamic_string(&insert_pat, "", 1024, 1024); {
insert_pat_inited= 1;
if (init_dynamic_string(&insert_pat, "", 1024, 1024))
safe_exit(EX_MYSQLERR);
}
else else
dynstr_set(&insert_pat, ""); dynstr_set(&insert_pat, "");
} }
@ -2134,7 +2161,7 @@ continue_xml:
*/ */
static void dump_triggers_for_table (char *table, char *db) static void dump_triggers_for_table(char *table, char *db)
{ {
char *result_table; char *result_table;
char name_buff[NAME_LEN*4+3], table_buff[NAME_LEN*2+3]; char name_buff[NAME_LEN*4+3], table_buff[NAME_LEN*2+3];
@ -2980,6 +3007,8 @@ static int dump_databases(char **db_names)
{ {
int result=0; int result=0;
char **db; char **db;
DBUG_ENTER("dump_databases");
for (db= db_names ; *db ; db++) for (db= db_names ; *db ; db++)
{ {
if (dump_all_tables_in_db(*db)) if (dump_all_tables_in_db(*db))
@ -2993,7 +3022,7 @@ static int dump_databases(char **db_names)
result=1; result=1;
} }
} }
return result; DBUG_RETURN(result);
} /* dump_databases */ } /* dump_databases */
@ -3008,7 +3037,7 @@ RETURN VALUES
0 Success. 0 Success.
1 Failure. 1 Failure.
*/ */
int init_dumping_views(char *qdatabase) int init_dumping_views(char *qdatabase __attribute__((unused)))
{ {
return 0; return 0;
} /* init_dumping_views */ } /* init_dumping_views */
@ -3105,12 +3134,11 @@ static int init_dumping(char *database, int init_func(char*))
} /* init_dumping */ } /* init_dumping */
/* Return 1 if we should copy the table */
my_bool include_table(byte* hash_key, uint len) my_bool include_table(byte* hash_key, uint len)
{ {
if (hash_search(&ignore_table, (byte*) hash_key, len)) return !hash_search(&ignore_table, (byte*) hash_key, len);
return FALSE;
return TRUE;
} }
@ -3119,10 +3147,10 @@ static int dump_all_tables_in_db(char *database)
char *table; char *table;
uint numrows; uint numrows;
char table_buff[NAME_LEN*2+3]; char table_buff[NAME_LEN*2+3];
char hash_key[2*NAME_LEN+2]; /* "db.tablename" */ char hash_key[2*NAME_LEN+2]; /* "db.tablename" */
char *afterdot; char *afterdot;
int using_mysql_db= my_strcasecmp(&my_charset_latin1, database, "mysql"); int using_mysql_db= my_strcasecmp(&my_charset_latin1, database, "mysql");
DBUG_ENTER("dump_all_tables_in_db");
afterdot= strmov(hash_key, database); afterdot= strmov(hash_key, database);
*afterdot++= '.'; *afterdot++= '.';
@ -3558,7 +3586,6 @@ static void print_value(FILE *file, MYSQL_RES *result, MYSQL_ROW row,
/* /*
SYNOPSIS SYNOPSIS
Check if we the table is one of the table types that should be ignored: Check if we the table is one of the table types that should be ignored:
@ -3598,8 +3625,8 @@ char check_if_ignore_table(const char *table_name, char *table_type)
{ {
if (mysql_errno(mysql) != ER_PARSE_ERROR) if (mysql_errno(mysql) != ER_PARSE_ERROR)
{ /* If old MySQL version */ { /* If old MySQL version */
verbose_msg("-- Warning: Couldn't get status information for " \ verbose_msg("-- Warning: Couldn't get status information for "
"table %s (%s)\n", table_name,mysql_error(mysql)); "table %s (%s)\n", table_name, mysql_error(mysql));
DBUG_RETURN(result); /* assume table is ok */ DBUG_RETURN(result); /* assume table is ok */
} }
} }
@ -3954,19 +3981,24 @@ static my_bool get_view_structure(char *table, char* db)
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
int exit_code;
MY_INIT("mysqldump"); MY_INIT("mysqldump");
compatible_mode_normal_str[0]= 0; compatible_mode_normal_str[0]= 0;
default_charset= (char *)mysql_universal_client_charset; default_charset= (char *)mysql_universal_client_charset;
bzero((char*) &ignore_table, sizeof(ignore_table)); bzero((char*) &ignore_table, sizeof(ignore_table));
if (get_options(&argc, &argv)) exit_code= get_options(&argc, &argv);
if (exit_code)
{ {
my_end(0); free_resources(0);
exit(EX_USAGE); exit(exit_code);
} }
if (dbConnect(current_host, current_user, opt_password)) if (connect_to_db(current_host, current_user, opt_password))
{
free_resources(0);
exit(EX_MYSQLERR); exit(EX_MYSQLERR);
}
if (!path) if (!path)
write_header(md_result_file, *argv); write_header(md_result_file, *argv);
@ -4016,15 +4048,6 @@ err:
dbDisconnect(current_host); dbDisconnect(current_host);
if (!path) if (!path)
write_footer(md_result_file); write_footer(md_result_file);
if (md_result_file != stdout) free_resources();
my_fclose(md_result_file, MYF(0));
my_free(opt_password, MYF(MY_ALLOW_ZERO_PTR));
if (hash_inited(&ignore_table))
hash_free(&ignore_table);
if (extended_insert)
dynstr_free(&extended_row);
if (insert_pat_inited)
dynstr_free(&insert_pat);
my_end(0);
return(first_error); return(first_error);
} /* main */ } /* main */

View File

@ -434,7 +434,7 @@ rl_translate_keyseq (seq, array, len)
{ {
register int i, c, l, temp; register int i, c, l, temp;
for (i = l = 0; c = seq[i]; i++) for (i = l = 0; (c = seq[i]); i++)
{ {
if (c == '\\') if (c == '\\')
{ {
@ -765,8 +765,8 @@ _rl_read_file (filename, sizep)
/* Re-read the current keybindings file. */ /* Re-read the current keybindings file. */
int int
rl_re_read_init_file (count, ignore) rl_re_read_init_file (int count __attribute__((unused)),
int count, ignore; int ignore __attribute__((unused)))
{ {
int r; int r;
r = rl_read_init_file ((const char *)NULL); r = rl_read_init_file ((const char *)NULL);
@ -987,8 +987,7 @@ parser_if (args)
/* Invert the current parser state if there is anything on the stack. */ /* Invert the current parser state if there is anything on the stack. */
static int static int
parser_else (args) parser_else (char *args __attribute__((unused)))
char *args;
{ {
register int i; register int i;
@ -1018,8 +1017,7 @@ parser_else (args)
/* Terminate a conditional, popping the value of /* Terminate a conditional, popping the value of
_rl_parsing_conditionalized_out from the stack. */ _rl_parsing_conditionalized_out from the stack. */
static int static int
parser_endif (args) parser_endif (char *args __attribute__((unused)))
char *args;
{ {
if (if_stack_depth) if (if_stack_depth)
_rl_parsing_conditionalized_out = if_stack[--if_stack_depth]; _rl_parsing_conditionalized_out = if_stack[--if_stack_depth];
@ -1142,7 +1140,7 @@ rl_parse_and_bind (string)
{ {
int passc = 0; int passc = 0;
for (i = 1; c = string[i]; i++) for (i = 1; (c = string[i]); i++)
{ {
if (passc) if (passc)
{ {
@ -1218,7 +1216,7 @@ rl_parse_and_bind (string)
{ {
int delimiter = string[i++], passc; int delimiter = string[i++], passc;
for (passc = 0; c = string[i]; i++) for (passc = 0; (c = string[i]); i++)
{ {
if (passc) if (passc)
{ {
@ -1377,7 +1375,7 @@ static struct {
#if defined (VISIBLE_STATS) #if defined (VISIBLE_STATS)
{ "visible-stats", &rl_visible_stats, 0 }, { "visible-stats", &rl_visible_stats, 0 },
#endif /* VISIBLE_STATS */ #endif /* VISIBLE_STATS */
{ (char *)NULL, (int *)NULL } { (char *)NULL, (int *)NULL, 0 }
}; };
static int static int
@ -1446,7 +1444,7 @@ static struct {
{ "editing-mode", V_STRING, sv_editmode }, { "editing-mode", V_STRING, sv_editmode },
{ "isearch-terminators", V_STRING, sv_isrchterm }, { "isearch-terminators", V_STRING, sv_isrchterm },
{ "keymap", V_STRING, sv_keymap }, { "keymap", V_STRING, sv_keymap },
{ (char *)NULL, 0 } { (char *)NULL, 0, 0 }
}; };
static int static int
@ -1466,7 +1464,7 @@ find_string_var (name)
values result in 0 (false). */ values result in 0 (false). */
static int static int
bool_to_int (value) bool_to_int (value)
char *value; const char *value;
{ {
return (value == 0 || *value == '\0' || return (value == 0 || *value == '\0' ||
(_rl_stricmp (value, "on") == 0) || (_rl_stricmp (value, "on") == 0) ||
@ -1725,13 +1723,13 @@ char *
rl_get_keymap_name_from_edit_mode () rl_get_keymap_name_from_edit_mode ()
{ {
if (rl_editing_mode == emacs_mode) if (rl_editing_mode == emacs_mode)
return "emacs"; return (char*) "emacs";
#if defined (VI_MODE) #if defined (VI_MODE)
else if (rl_editing_mode == vi_mode) else if (rl_editing_mode == vi_mode)
return "vi"; return (char*) "vi";
#endif /* VI_MODE */ #endif /* VI_MODE */
else else
return "none"; return (char*) "none";
} }
/* **************************************************************** */ /* **************************************************************** */
@ -1966,7 +1964,7 @@ rl_function_dumper (print_readably)
fprintf (rl_outstream, "\n"); fprintf (rl_outstream, "\n");
for (i = 0; name = names[i]; i++) for (i = 0; (name = names[i]); i++)
{ {
rl_command_func_t *function; rl_command_func_t *function;
char **invokers; char **invokers;
@ -2025,8 +2023,8 @@ rl_function_dumper (print_readably)
rl_outstream. If an explicit argument is given, then print rl_outstream. If an explicit argument is given, then print
the output in such a way that it can be read back in. */ the output in such a way that it can be read back in. */
int int
rl_dump_functions (count, key) rl_dump_functions (int count __attribute__((unused)),
int count, key; int key __attribute__((unused)))
{ {
if (rl_dispatching) if (rl_dispatching)
fprintf (rl_outstream, "\r\n"); fprintf (rl_outstream, "\r\n");
@ -2105,8 +2103,7 @@ rl_macro_dumper (print_readably)
} }
int int
rl_dump_macros (count, key) rl_dump_macros(int count __attribute__((unused)), int key __attribute__((unused)))
int count, key;
{ {
if (rl_dispatching) if (rl_dispatching)
fprintf (rl_outstream, "\r\n"); fprintf (rl_outstream, "\r\n");
@ -2195,8 +2192,7 @@ rl_variable_dumper (print_readably)
rl_outstream. If an explicit argument is given, then print rl_outstream. If an explicit argument is given, then print
the output in such a way that it can be read back in. */ the output in such a way that it can be read back in. */
int int
rl_dump_variables (count, key) rl_dump_variables(int count __attribute__((unused)), int key __attribute__((unused)))
int count, key;
{ {
if (rl_dispatching) if (rl_dispatching)
fprintf (rl_outstream, "\r\n"); fprintf (rl_outstream, "\r\n");

View File

@ -59,7 +59,11 @@
#define largest_char 255 /* Largest character value. */ #define largest_char 255 /* Largest character value. */
#define CTRL_CHAR(c) ((c) < control_character_threshold && (((c) & 0x80) == 0)) #define CTRL_CHAR(c) ((c) < control_character_threshold && (((c) & 0x80) == 0))
#if largest_char >= 255
#define META_CHAR(c) ((c) > meta_character_threshold)
#else
#define META_CHAR(c) ((c) > meta_character_threshold && (c) <= largest_char) #define META_CHAR(c) ((c) > meta_character_threshold && (c) <= largest_char)
#endif
#define CTRL(c) ((c) & control_character_mask) #define CTRL(c) ((c) & control_character_mask)
#define META(c) ((c) | meta_character_bit) #define META(c) ((c) | meta_character_bit)

View File

@ -361,15 +361,15 @@ rl_complete (ignore, invoking_key)
/* List the possible completions. See description of rl_complete (). */ /* List the possible completions. See description of rl_complete (). */
int int
rl_possible_completions (ignore, invoking_key) rl_possible_completions (int ignore __attribute__((unused)),
int ignore, invoking_key; int invoking_key __attribute__((unused)))
{ {
return (rl_complete_internal ('?')); return (rl_complete_internal ('?'));
} }
int int
rl_insert_completions (ignore, invoking_key) rl_insert_completions (int ignore __attribute__((unused)),
int ignore, invoking_key; int invoking_key __attribute__((unused)))
{ {
return (rl_complete_internal ('*')); return (rl_complete_internal ('*'));
} }
@ -761,10 +761,7 @@ print_filename (to_print, full_pathname)
} }
static char * static char *
rl_quote_filename (s, rtype, qcp) rl_quote_filename (char *s, int rtype __attribute__((unused)), char *qcp)
char *s;
int rtype;
char *qcp;
{ {
char *r; char *r;
@ -872,7 +869,7 @@ _rl_find_completion_word (fp, dp)
completion, so use the word break characters to find the completion, so use the word break characters to find the
substring on which to complete. */ substring on which to complete. */
#if defined (HANDLE_MULTIBYTE) #if defined (HANDLE_MULTIBYTE)
while (rl_point = _rl_find_prev_mbchar (rl_line_buffer, rl_point, MB_FIND_ANY)) while ((rl_point = _rl_find_prev_mbchar (rl_line_buffer, rl_point, MB_FIND_ANY)))
#else #else
while (--rl_point) while (--rl_point)
#endif #endif
@ -1806,7 +1803,7 @@ rl_completion_matches (text, entry_function)
match_list = (char **)xmalloc ((match_list_size + 1) * sizeof (char *)); match_list = (char **)xmalloc ((match_list_size + 1) * sizeof (char *));
match_list[1] = (char *)NULL; match_list[1] = (char *)NULL;
while (string = (*entry_function) (text, matches)) while ((string = (*entry_function) (text, matches)))
{ {
if (matches + 1 == match_list_size) if (matches + 1 == match_list_size)
match_list = (char **)xrealloc match_list = (char **)xrealloc
@ -1856,7 +1853,7 @@ rl_username_completion_function (text, state)
setpwent (); setpwent ();
} }
while (entry = getpwent ()) while ((entry = getpwent ()))
{ {
/* Null usernames should result in all users as possible completions. */ /* Null usernames should result in all users as possible completions. */
if (namelen == 0 || (STREQN (username, entry->pw_name, namelen))) if (namelen == 0 || (STREQN (username, entry->pw_name, namelen)))
@ -2092,8 +2089,7 @@ rl_filename_completion_function (text, state)
hit the end of the match list, we restore the original unmatched text, hit the end of the match list, we restore the original unmatched text,
ring the bell, and reset the counter to zero. */ ring the bell, and reset the counter to zero. */
int int
rl_menu_complete (count, ignore) rl_menu_complete (int count, int ignore __attribute__((unused)))
int count, ignore;
{ {
rl_compentry_func_t *our_func; rl_compentry_func_t *our_func;
int matching_filenames, found_quote; int matching_filenames, found_quote;

View File

@ -218,7 +218,7 @@ expand_prompt (pmt, lp, lip, niflp, vlp)
if (niflp) if (niflp)
*niflp = 0; *niflp = 0;
if (vlp) if (vlp)
*vlp = lp ? *lp : strlen (r); *vlp = lp ? *lp : (int) strlen (r);
return r; return r;
} }
@ -435,7 +435,7 @@ rl_redisplay ()
return; return;
if (!rl_display_prompt) if (!rl_display_prompt)
rl_display_prompt = ""; rl_display_prompt = (char*) "";
if (invisible_line == 0) if (invisible_line == 0)
{ {
@ -757,7 +757,7 @@ rl_redisplay ()
c_pos = out; c_pos = out;
lb_linenum = newlines; lb_linenum = newlines;
} }
for (i = in; i < in+wc_bytes; i++) for (i = in; i < (int) (in+wc_bytes); i++)
line[out++] = rl_line_buffer[i]; line[out++] = rl_line_buffer[i];
for (i = 0; i < wc_width; i++) for (i = 0; i < wc_width; i++)
CHECK_LPOS(); CHECK_LPOS();
@ -835,7 +835,7 @@ rl_redisplay ()
#define VIS_LLEN(l) ((l) > _rl_vis_botlin ? 0 : (vis_lbreaks[l+1] - vis_lbreaks[l])) #define VIS_LLEN(l) ((l) > _rl_vis_botlin ? 0 : (vis_lbreaks[l+1] - vis_lbreaks[l]))
#define INV_LLEN(l) (inv_lbreaks[l+1] - inv_lbreaks[l]) #define INV_LLEN(l) (inv_lbreaks[l+1] - inv_lbreaks[l])
#define VIS_CHARS(line) (visible_line + vis_lbreaks[line]) #define VIS_CHARS(line) (visible_line + vis_lbreaks[line])
#define VIS_LINE(line) ((line) > _rl_vis_botlin) ? "" : VIS_CHARS(line) #define VIS_LINE(line) ((line) > _rl_vis_botlin) ? (char*) "" : VIS_CHARS(line)
#define INV_LINE(line) (invisible_line + inv_lbreaks[line]) #define INV_LINE(line) (invisible_line + inv_lbreaks[line])
/* For each line in the buffer, do the updating display. */ /* For each line in the buffer, do the updating display. */
@ -876,7 +876,7 @@ rl_redisplay ()
_rl_move_vert (linenum); _rl_move_vert (linenum);
_rl_move_cursor_relative (0, tt); _rl_move_cursor_relative (0, tt);
_rl_clear_to_eol _rl_clear_to_eol
((linenum == _rl_vis_botlin) ? strlen (tt) : _rl_screenwidth); ((linenum == _rl_vis_botlin) ? (int) strlen (tt) : _rl_screenwidth);
} }
} }
_rl_vis_botlin = inv_botlin; _rl_vis_botlin = inv_botlin;
@ -1086,7 +1086,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
int col_lendiff, col_temp; int col_lendiff, col_temp;
#if defined (HANDLE_MULTIBYTE) #if defined (HANDLE_MULTIBYTE)
mbstate_t ps_new, ps_old; mbstate_t ps_new, ps_old;
int new_offset, old_offset, tmp; int new_offset, old_offset;
#endif #endif
/* If we're at the right edge of a terminal that supports xn, we're /* If we're at the right edge of a terminal that supports xn, we're
@ -1837,7 +1837,7 @@ rl_reset_line_state ()
{ {
rl_on_new_line (); rl_on_new_line ();
rl_display_prompt = rl_prompt ? rl_prompt : ""; rl_display_prompt = rl_prompt ? rl_prompt : (char*) "";
forced_display = 1; forced_display = 1;
return 0; return 0;
} }
@ -2212,7 +2212,7 @@ _rl_col_width (str, start, end)
int start, end; int start, end;
{ {
wchar_t wc; wchar_t wc;
mbstate_t ps = {0}; mbstate_t ps;
int tmp, point, width, max; int tmp, point, width, max;
if (end <= start) if (end <= start)
@ -2221,6 +2221,7 @@ _rl_col_width (str, start, end)
point = 0; point = 0;
max = end; max = end;
memset (&ps, 0, sizeof(ps));
while (point < start) while (point < start)
{ {
tmp = mbrlen (str + point, max, &ps); tmp = mbrlen (str + point, max, &ps);

View File

@ -87,14 +87,14 @@ char history_comment_char = '\0';
/* The list of characters which inhibit the expansion of text if found /* The list of characters which inhibit the expansion of text if found
immediately following history_expansion_char. */ immediately following history_expansion_char. */
char *history_no_expand_chars = " \t\n\r="; char *history_no_expand_chars = (char*) " \t\n\r=";
/* If set to a non-zero value, single quotes inhibit history expansion. /* If set to a non-zero value, single quotes inhibit history expansion.
The default is 0. */ The default is 0. */
int history_quotes_inhibit_expansion = 0; int history_quotes_inhibit_expansion = 0;
/* Used to split words by history_tokenize_internal. */ /* Used to split words by history_tokenize_internal. */
char *history_word_delimiters = HISTORY_WORD_DELIMITERS; char *history_word_delimiters = (char*) HISTORY_WORD_DELIMITERS;
/* If set, this points to a function that is called to verify that a /* If set, this points to a function that is called to verify that a
particular history expansion should be performed. */ particular history expansion should be performed. */
@ -203,7 +203,7 @@ get_history_event (string, caller_index, delimiting_quote)
} }
/* Only a closing `?' or a newline delimit a substring search string. */ /* Only a closing `?' or a newline delimit a substring search string. */
for (local_index = i; c = string[i]; i++) for (local_index = i; (c = string[i]); i++)
#if defined (HANDLE_MULTIBYTE) #if defined (HANDLE_MULTIBYTE)
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0) if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
{ {

View File

@ -405,7 +405,7 @@ rl_read_key ()
else else
{ {
/* If input is coming from a macro, then use that. */ /* If input is coming from a macro, then use that. */
if (c = _rl_next_macro_key ()) if ((c= _rl_next_macro_key ()))
return (c); return (c);
/* If the user has an event function, then call it periodically. */ /* If the user has an event function, then call it periodically. */

View File

@ -68,7 +68,7 @@ static char *prev_line_found;
static char *last_isearch_string; static char *last_isearch_string;
static int last_isearch_string_len; static int last_isearch_string_len;
static char *default_isearch_terminators = "\033\012"; static char *default_isearch_terminators = (char*) "\033\012";
/* Search backwards through the history looking for a string which is typed /* Search backwards through the history looking for a string which is typed
interactively. Start with the current line. */ interactively. Start with the current line. */
@ -94,9 +94,8 @@ rl_forward_search_history (sign, key)
WHERE is the history list number of the current line. If it is WHERE is the history list number of the current line. If it is
-1, then this line is the starting one. */ -1, then this line is the starting one. */
static void static void
rl_display_search (search_string, reverse_p, where) rl_display_search (char *search_string, int reverse_p,
char *search_string; int where __attribute__((unused)))
int reverse_p, where;
{ {
char *message; char *message;
int msglen, searchlen; int msglen, searchlen;
@ -143,8 +142,7 @@ rl_display_search (search_string, reverse_p, where)
DIRECTION is which direction to search; >= 0 means forward, < 0 means DIRECTION is which direction to search; >= 0 means forward, < 0 means
backwards. */ backwards. */
static int static int
rl_search_history (direction, invoking_key) rl_search_history (int direction, int invoking_key __attribute__((unused)))
int direction, invoking_key;
{ {
/* The string that the user types in to search for. */ /* The string that the user types in to search for. */
char *search_string; char *search_string;

View File

@ -76,8 +76,7 @@ static int rl_yank_nth_arg_internal PARAMS((int, int, int));
/* How to say that you only want to save a certain amount /* How to say that you only want to save a certain amount
of kill material. */ of kill material. */
int int
rl_set_retained_kills (num) rl_set_retained_kills (int num __attribute__((unused)))
int num;
{ {
return 0; return 0;
} }
@ -293,8 +292,8 @@ rl_backward_kill_line (direction, ignore)
/* Kill the whole line, no matter where point is. */ /* Kill the whole line, no matter where point is. */
int int
rl_kill_full_line (count, ignore) rl_kill_full_line (int count __attribute__((unused)),
int count, ignore; int ignore __attribute__((unused)))
{ {
rl_begin_undo_group (); rl_begin_undo_group ();
rl_point = 0; rl_point = 0;
@ -311,8 +310,7 @@ rl_kill_full_line (count, ignore)
/* This does what C-w does in Unix. We can't prevent people from /* This does what C-w does in Unix. We can't prevent people from
using behaviour that they expect. */ using behaviour that they expect. */
int int
rl_unix_word_rubout (count, key) rl_unix_word_rubout (int count, int key __attribute__((unused)))
int count, key;
{ {
int orig_point; int orig_point;
@ -344,8 +342,7 @@ rl_unix_word_rubout (count, key)
/* This deletes one filename component in a Unix pathname. That is, it /* This deletes one filename component in a Unix pathname. That is, it
deletes backward to directory separator (`/') or whitespace. */ deletes backward to directory separator (`/') or whitespace. */
int int
rl_unix_filename_rubout (count, key) rl_unix_filename_rubout (int count, int key __attribute__((unused)))
int count, key;
{ {
int orig_point, c; int orig_point, c;
@ -388,8 +385,8 @@ rl_unix_filename_rubout (count, key)
into the line at all, and if you aren't, then you know what you are into the line at all, and if you aren't, then you know what you are
doing. */ doing. */
int int
rl_unix_line_discard (count, key) rl_unix_line_discard (int count __attribute__((unused)),
int count, key; int key __attribute__((unused)))
{ {
if (rl_point == 0) if (rl_point == 0)
rl_ding (); rl_ding ();
@ -425,16 +422,16 @@ region_kill_internal (delete)
/* Copy the text in the region to the kill ring. */ /* Copy the text in the region to the kill ring. */
int int
rl_copy_region_to_kill (count, ignore) rl_copy_region_to_kill (int count __attribute__((unused)),
int count, ignore; int key __attribute__((unused)))
{ {
return (region_kill_internal (0)); return (region_kill_internal (0));
} }
/* Kill the text between the point and mark. */ /* Kill the text between the point and mark. */
int int
rl_kill_region (count, ignore) rl_kill_region (int count __attribute__((unused)),
int count, ignore; int ignore __attribute__((unused)))
{ {
int r, npoint; int r, npoint;
@ -498,8 +495,7 @@ rl_copy_backward_word (count, key)
/* Yank back the last killed text. This ignores arguments. */ /* Yank back the last killed text. This ignores arguments. */
int int
rl_yank (count, ignore) rl_yank (int count __attribute__((unused)), int ignore __attribute__((unused)))
int count, ignore;
{ {
if (rl_kill_ring == 0) if (rl_kill_ring == 0)
{ {
@ -517,8 +513,7 @@ rl_yank (count, ignore)
delete that text from the line, rotate the index down, and delete that text from the line, rotate the index down, and
yank back some other text. */ yank back some other text. */
int int
rl_yank_pop (count, key) rl_yank_pop (int count __attribute__((unused)), int key __attribute__((unused)))
int count, key;
{ {
int l, n; int l, n;

View File

@ -189,8 +189,8 @@ _rl_kill_kbd_macro ()
definition to the end of the existing macro, and start by definition to the end of the existing macro, and start by
re-executing the existing macro. */ re-executing the existing macro. */
int int
rl_start_kbd_macro (ignore1, ignore2) rl_start_kbd_macro (int ignore1 __attribute__((unused)),
int ignore1, ignore2; int ignore2 __attribute__((unused)))
{ {
if (RL_ISSTATE (RL_STATE_MACRODEF)) if (RL_ISSTATE (RL_STATE_MACRODEF))
{ {
@ -214,8 +214,7 @@ rl_start_kbd_macro (ignore1, ignore2)
A numeric argument says to execute the macro right now, A numeric argument says to execute the macro right now,
that many times, counting the definition as the first time. */ that many times, counting the definition as the first time. */
int int
rl_end_kbd_macro (count, ignore) rl_end_kbd_macro (int count, int ignore __attribute__((unused)))
int count, ignore;
{ {
if (RL_ISSTATE (RL_STATE_MACRODEF) == 0) if (RL_ISSTATE (RL_STATE_MACRODEF) == 0)
{ {
@ -234,8 +233,7 @@ rl_end_kbd_macro (count, ignore)
/* Execute the most recently defined keyboard macro. /* Execute the most recently defined keyboard macro.
COUNT says how many times to execute it. */ COUNT says how many times to execute it. */
int int
rl_call_last_kbd_macro (count, ignore) rl_call_last_kbd_macro (int count, int ignore __attribute__((unused)))
int count, ignore;
{ {
if (current_macro == 0) if (current_macro == 0)
_rl_abort_internal (); _rl_abort_internal ();

View File

@ -154,8 +154,7 @@ rl_digit_loop ()
/* Add the current digit to the argument in progress. */ /* Add the current digit to the argument in progress. */
int int
rl_digit_argument (ignore, key) rl_digit_argument (int ignore __attribute__((unused)), int key)
int ignore, key;
{ {
rl_execute_next (key); rl_execute_next (key);
return (rl_digit_loop ()); return (rl_digit_loop ());
@ -184,8 +183,8 @@ _rl_init_argument ()
Read a key. If the key has nothing to do with arguments, then Read a key. If the key has nothing to do with arguments, then
dispatch on it. If the key is the abort character then abort. */ dispatch on it. If the key is the abort character then abort. */
int int
rl_universal_argument (count, key) rl_universal_argument (int count __attribute__((unused)),
int count, key; int key __attribute__((unused)))
{ {
rl_numeric_arg *= 4; rl_numeric_arg *= 4;
return (rl_digit_loop ()); return (rl_digit_loop ());
@ -314,9 +313,7 @@ _rl_history_set_point ()
} }
void void
rl_replace_from_history (entry, flags) rl_replace_from_history (HIST_ENTRY *entry, int flags __attribute__((unused)))
HIST_ENTRY *entry;
int flags; /* currently unused */
{ {
/* Can't call with `1' because rl_undo_list might point to an undo list /* Can't call with `1' because rl_undo_list might point to an undo list
from a history entry, just like we're setting up here. */ from a history entry, just like we're setting up here. */
@ -342,16 +339,15 @@ rl_replace_from_history (entry, flags)
/* Meta-< goes to the start of the history. */ /* Meta-< goes to the start of the history. */
int int
rl_beginning_of_history (count, key) rl_beginning_of_history (int count __attribute__((unused)), int key)
int count, key;
{ {
return (rl_get_previous_history (1 + where_history (), key)); return (rl_get_previous_history (1 + where_history (), key));
} }
/* Meta-> goes to the end of the history. (The current line). */ /* Meta-> goes to the end of the history. (The current line). */
int int
rl_end_of_history (count, key) rl_end_of_history (int count __attribute__((unused)),
int count, key; int key __attribute__((unused)))
{ {
rl_maybe_replace_line (); rl_maybe_replace_line ();
using_history (); using_history ();
@ -455,8 +451,7 @@ rl_get_previous_history (count, key)
/* **************************************************************** */ /* **************************************************************** */
/* How to toggle back and forth between editing modes. */ /* How to toggle back and forth between editing modes. */
int int
rl_vi_editing_mode (count, key) rl_vi_editing_mode (int count __attribute__((unused)), int key)
int count, key;
{ {
#if defined (VI_MODE) #if defined (VI_MODE)
_rl_set_insert_mode (RL_IM_INSERT, 1); /* vi mode ignores insert mode */ _rl_set_insert_mode (RL_IM_INSERT, 1); /* vi mode ignores insert mode */
@ -468,8 +463,8 @@ rl_vi_editing_mode (count, key)
} }
int int
rl_emacs_editing_mode (count, key) rl_emacs_editing_mode (int count __attribute__((unused)),
int count, key; int key __attribute__((unused)))
{ {
rl_editing_mode = emacs_mode; rl_editing_mode = emacs_mode;
_rl_set_insert_mode (RL_IM_INSERT, 1); /* emacs mode default is insert mode */ _rl_set_insert_mode (RL_IM_INSERT, 1); /* emacs mode default is insert mode */
@ -479,8 +474,7 @@ rl_emacs_editing_mode (count, key)
/* Function for the rest of the library to use to set insert/overwrite mode. */ /* Function for the rest of the library to use to set insert/overwrite mode. */
void void
_rl_set_insert_mode (im, force) _rl_set_insert_mode (int im, int force __attribute__((unused)))
int im, force;
{ {
#ifdef CURSOR_MODE #ifdef CURSOR_MODE
_rl_set_cursor (im, force); _rl_set_cursor (im, force);
@ -492,8 +486,7 @@ _rl_set_insert_mode (im, force)
/* Toggle overwrite mode. A positive explicit argument selects overwrite /* Toggle overwrite mode. A positive explicit argument selects overwrite
mode. A negative or zero explicit argument selects insert mode. */ mode. A negative or zero explicit argument selects insert mode. */
int int
rl_overwrite_mode (count, key) rl_overwrite_mode (int count, int key __attribute__((unused)))
int count, key;
{ {
if (rl_explicit_arg == 0) if (rl_explicit_arg == 0)
_rl_set_insert_mode (rl_insert_mode ^ 1, 0); _rl_set_insert_mode (rl_insert_mode ^ 1, 0);

View File

@ -111,7 +111,7 @@ _rl_init_eightbit ()
if (lspec == 0 || *lspec == 0) if (lspec == 0 || *lspec == 0)
lspec = setlocale (LC_CTYPE, (char *)NULL); lspec = setlocale (LC_CTYPE, (char *)NULL);
if (lspec == 0) if (lspec == 0)
lspec = ""; lspec = (char*) "";
t = setlocale (LC_CTYPE, lspec); t = setlocale (LC_CTYPE, lspec);
if (t && *t && (t[0] != 'C' || t[1]) && (STREQ (t, "POSIX") == 0)) if (t && *t && (t[0] != 'C' || t[1]) && (STREQ (t, "POSIX") == 0))

View File

@ -83,7 +83,9 @@ static void bind_arrow_keys_internal PARAMS((Keymap));
static void bind_arrow_keys PARAMS((void)); static void bind_arrow_keys PARAMS((void));
static void readline_default_bindings PARAMS((void)); static void readline_default_bindings PARAMS((void));
#ifdef NOT_USED
static void reset_default_bindings PARAMS((void)); static void reset_default_bindings PARAMS((void));
#endif
/* **************************************************************** */ /* **************************************************************** */
/* */ /* */
@ -866,12 +868,14 @@ readline_default_bindings ()
/* Reset the default bindings for the terminal special characters we're /* Reset the default bindings for the terminal special characters we're
interested in back to rl_insert and read the new ones. */ interested in back to rl_insert and read the new ones. */
#ifdef NOT_USED
static void static void
reset_default_bindings () reset_default_bindings ()
{ {
rl_tty_unset_default_bindings (_rl_keymap); rl_tty_unset_default_bindings (_rl_keymap);
rl_tty_set_default_bindings (_rl_keymap); rl_tty_set_default_bindings (_rl_keymap);
} }
#endif
/* Bind some common arrow key sequences in MAP. */ /* Bind some common arrow key sequences in MAP. */
static void static void

View File

@ -716,8 +716,7 @@ rl_deprep_terminal ()
/* **************************************************************** */ /* **************************************************************** */
int int
rl_restart_output (count, key) rl_restart_output(int count __attribute__((unused)), int key __attribute__((unused)))
int count, key;
{ {
int fildes = fileno (rl_outstream); int fildes = fileno (rl_outstream);
#if defined (TIOCSTART) #if defined (TIOCSTART)
@ -749,8 +748,7 @@ rl_restart_output (count, key)
} }
int int
rl_stop_output (count, key) rl_stop_output(int count __attribute__((unused)), int key __attribute__((unused)))
int count, key;
{ {
int fildes = fileno (rl_instream); int fildes = fileno (rl_instream);
@ -867,7 +865,6 @@ rltty_set_default_bindings (kmap)
{ {
TIOTYPE ttybuff; TIOTYPE ttybuff;
int tty; int tty;
static int called = 0;
tty = fileno (rl_instream); tty = fileno (rl_instream);

View File

@ -303,8 +303,7 @@ noninc_search (dir, pchar)
/* Search forward through the history list for a string. If the vi-mode /* Search forward through the history list for a string. If the vi-mode
code calls this, KEY will be `?'. */ code calls this, KEY will be `?'. */
int int
rl_noninc_forward_search (count, key) rl_noninc_forward_search (int count __attribute__((unused)), int key)
int count, key;
{ {
noninc_search (1, (key == '?') ? '?' : 0); noninc_search (1, (key == '?') ? '?' : 0);
return 0; return 0;
@ -313,8 +312,7 @@ rl_noninc_forward_search (count, key)
/* Reverse search the history list for a string. If the vi-mode code /* Reverse search the history list for a string. If the vi-mode code
calls this, KEY will be `/'. */ calls this, KEY will be `/'. */
int int
rl_noninc_reverse_search (count, key) rl_noninc_reverse_search (int count __attribute__((unused)), int key)
int count, key;
{ {
noninc_search (-1, (key == '/') ? '/' : 0); noninc_search (-1, (key == '/') ? '/' : 0);
return 0; return 0;
@ -323,8 +321,8 @@ rl_noninc_reverse_search (count, key)
/* Search forward through the history list for the last string searched /* Search forward through the history list for the last string searched
for. If there is no saved search string, abort. */ for. If there is no saved search string, abort. */
int int
rl_noninc_forward_search_again (count, key) rl_noninc_forward_search_again (int count __attribute__((unused)),
int count, key; int key __attribute__((unused)))
{ {
if (!noninc_search_string) if (!noninc_search_string)
{ {
@ -338,8 +336,8 @@ rl_noninc_forward_search_again (count, key)
/* Reverse search in the history list for the last string searched /* Reverse search in the history list for the last string searched
for. If there is no saved search string, abort. */ for. If there is no saved search string, abort. */
int int
rl_noninc_reverse_search_again (count, key) rl_noninc_reverse_search_again (int count __attribute__((unused)),
int count, key; int key __attribute__((unused)))
{ {
if (!noninc_search_string) if (!noninc_search_string)
{ {

View File

@ -344,7 +344,7 @@ get_term_capabilities (bp)
#if !defined (__DJGPP__) /* XXX - doesn't DJGPP have a termcap library? */ #if !defined (__DJGPP__) /* XXX - doesn't DJGPP have a termcap library? */
register int i; register int i;
for (i = 0; i < NUM_TC_STRINGS; i++) for (i = 0; i < (int) NUM_TC_STRINGS; i++)
*(tc_strings[i].tc_value) = tgetstr ((char *)tc_strings[i].tc_var, bp); *(tc_strings[i].tc_value) = tgetstr ((char *)tc_strings[i].tc_var, bp);
#endif #endif
tcap_initialized = 1; tcap_initialized = 1;
@ -410,7 +410,7 @@ _rl_init_terminal_io (terminal_name)
/* Everything below here is used by the redisplay code (tputs). */ /* Everything below here is used by the redisplay code (tputs). */
_rl_screenchars = _rl_screenwidth * _rl_screenheight; _rl_screenchars = _rl_screenwidth * _rl_screenheight;
_rl_term_cr = "\r"; _rl_term_cr = (char*) "\r";
_rl_term_im = _rl_term_ei = _rl_term_ic = _rl_term_IC = (char *)NULL; _rl_term_im = _rl_term_ei = _rl_term_ic = _rl_term_IC = (char *)NULL;
_rl_term_up = _rl_term_dc = _rl_term_DC = _rl_visible_bell = (char *)NULL; _rl_term_up = _rl_term_dc = _rl_term_DC = _rl_visible_bell = (char *)NULL;
_rl_term_ku = _rl_term_kd = _rl_term_kl = _rl_term_kr = (char *)NULL; _rl_term_ku = _rl_term_kd = _rl_term_kl = _rl_term_kr = (char *)NULL;
@ -427,7 +427,7 @@ _rl_init_terminal_io (terminal_name)
tgoto if _rl_term_IC or _rl_term_DC is defined, but just in case we tgoto if _rl_term_IC or _rl_term_DC is defined, but just in case we
change that later... */ change that later... */
PC = '\0'; PC = '\0';
BC = _rl_term_backspace = "\b"; BC = _rl_term_backspace = (char*) "\b";
UP = _rl_term_up; UP = _rl_term_up;
return 0; return 0;
@ -442,7 +442,7 @@ _rl_init_terminal_io (terminal_name)
UP = _rl_term_up; UP = _rl_term_up;
if (!_rl_term_cr) if (!_rl_term_cr)
_rl_term_cr = "\r"; _rl_term_cr = (char*) "\r";
_rl_term_autowrap = tgetflag ("am") && tgetflag ("xn"); _rl_term_autowrap = tgetflag ("am") && tgetflag ("xn");
@ -502,7 +502,7 @@ rl_get_termcap (cap)
if (tcap_initialized == 0) if (tcap_initialized == 0)
return ((char *)NULL); return ((char *)NULL);
for (i = 0; i < NUM_TC_STRINGS; i++) for (i = 0; i < (int) NUM_TC_STRINGS; i++)
{ {
if (tc_strings[i].tc_var[0] == cap[0] && strcmp (tc_strings[i].tc_var, cap) == 0) if (tc_strings[i].tc_var[0] == cap[0] && strcmp (tc_strings[i].tc_var, cap) == 0)
return *(tc_strings[i].tc_value); return *(tc_strings[i].tc_value);

View File

@ -402,8 +402,7 @@ rl_backward (count, key)
/* Move to the beginning of the line. */ /* Move to the beginning of the line. */
int int
rl_beg_of_line (count, key) rl_beg_of_line (int count __attribute__((unused)), int key __attribute__((unused)))
int count, key;
{ {
rl_point = 0; rl_point = 0;
return 0; return 0;
@ -411,8 +410,7 @@ rl_beg_of_line (count, key)
/* Move to the end of the line. */ /* Move to the end of the line. */
int int
rl_end_of_line (count, key) rl_end_of_line (int count __attribute__((unused)), int key __attribute__((unused)))
int count, key;
{ {
rl_point = rl_end; rl_point = rl_end;
return 0; return 0;
@ -508,8 +506,7 @@ rl_backward_word (count, key)
/* Clear the current line. Numeric argument to C-l does this. */ /* Clear the current line. Numeric argument to C-l does this. */
int int
rl_refresh_line (ignore1, ignore2) rl_refresh_line (int count __attribute__((unused)), int key __attribute__((unused)))
int ignore1, ignore2;
{ {
int curr_line; int curr_line;
@ -547,8 +544,7 @@ rl_clear_screen (count, key)
} }
int int
rl_arrow_keys (count, c) rl_arrow_keys (int count, int c __attribute__((unused)))
int count, c;
{ {
int ch; int ch;
@ -596,7 +592,7 @@ rl_arrow_keys (count, c)
#ifdef HANDLE_MULTIBYTE #ifdef HANDLE_MULTIBYTE
static char pending_bytes[MB_LEN_MAX]; static char pending_bytes[MB_LEN_MAX];
static int pending_bytes_length = 0; static int pending_bytes_length = 0;
static mbstate_t ps = {0}; static mbstate_t ps;
#endif #endif
/* Insert the character C at the current location, moving point forward. /* Insert the character C at the current location, moving point forward.
@ -832,8 +828,7 @@ rl_insert (count, c)
/* Insert the next typed character verbatim. */ /* Insert the next typed character verbatim. */
int int
rl_quoted_insert (count, key) rl_quoted_insert (int count, int key __attribute__((unused)))
int count, key;
{ {
int c; int c;
@ -854,8 +849,7 @@ rl_quoted_insert (count, key)
/* Insert a tab character. */ /* Insert a tab character. */
int int
rl_tab_insert (count, key) rl_tab_insert (int count, int key __attribute__((unused)))
int count, key;
{ {
return (_rl_insert_char (count, '\t')); return (_rl_insert_char (count, '\t'));
} }
@ -864,8 +858,7 @@ rl_tab_insert (count, key)
KEY is the key that invoked this command. I guess it could have KEY is the key that invoked this command. I guess it could have
meaning in the future. */ meaning in the future. */
int int
rl_newline (count, key) rl_newline (int count __attribute__((unused)), int key __attribute__((unused)))
int count, key;
{ {
rl_done = 1; rl_done = 1;
@ -898,8 +891,8 @@ rl_newline (count, key)
is just a stub, you bind keys to it and the code in _rl_dispatch () is just a stub, you bind keys to it and the code in _rl_dispatch ()
is special cased. */ is special cased. */
int int
rl_do_lowercase_version (ignore1, ignore2) rl_do_lowercase_version (int count __attribute__((unused)),
int ignore1, ignore2; int key __attribute__((unused)))
{ {
return 0; return 0;
} }
@ -1093,8 +1086,8 @@ rl_rubout_or_delete (count, key)
/* Delete all spaces and tabs around point. */ /* Delete all spaces and tabs around point. */
int int
rl_delete_horizontal_space (count, ignore) rl_delete_horizontal_space (int count __attribute__((unused)),
int count, ignore; int key __attribute__((unused)))
{ {
int start = rl_point; int start = rl_point;
@ -1134,14 +1127,13 @@ rl_delete_or_show_completions (count, key)
/* Turn the current line into a comment in shell history. /* Turn the current line into a comment in shell history.
A K*rn shell style function. */ A K*rn shell style function. */
int int
rl_insert_comment (count, key) rl_insert_comment (int count __attribute__((unused)), int key)
int count, key;
{ {
char *rl_comment_text; char *rl_comment_text;
int rl_comment_len; int rl_comment_len;
rl_beg_of_line (1, key); rl_beg_of_line (1, key);
rl_comment_text = _rl_comment_begin ? _rl_comment_begin : RL_COMMENT_BEGIN_DEFAULT; rl_comment_text = _rl_comment_begin ? _rl_comment_begin : (char*) RL_COMMENT_BEGIN_DEFAULT;
if (rl_explicit_arg == 0) if (rl_explicit_arg == 0)
rl_insert_text (rl_comment_text); rl_insert_text (rl_comment_text);
@ -1173,24 +1165,21 @@ rl_insert_comment (count, key)
/* Uppercase the word at point. */ /* Uppercase the word at point. */
int int
rl_upcase_word (count, key) rl_upcase_word (int count, int key __attribute__((unused)))
int count, key;
{ {
return (rl_change_case (count, UpCase)); return (rl_change_case (count, UpCase));
} }
/* Lowercase the word at point. */ /* Lowercase the word at point. */
int int
rl_downcase_word (count, key) rl_downcase_word (int count, int key __attribute__((unused)))
int count, key;
{ {
return (rl_change_case (count, DownCase)); return (rl_change_case (count, DownCase));
} }
/* Upcase the first letter, downcase the rest. */ /* Upcase the first letter, downcase the rest. */
int int
rl_capitalize_word (count, key) rl_capitalize_word (int count, int key __attribute__((unused)))
int count, key;
{ {
return (rl_change_case (count, CapCase)); return (rl_change_case (count, CapCase));
} }
@ -1314,8 +1303,7 @@ rl_transpose_words (count, key)
/* Transpose the characters at point. If point is at the end of the line, /* Transpose the characters at point. If point is at the end of the line,
then transpose the characters before point. */ then transpose the characters before point. */
int int
rl_transpose_chars (count, key) rl_transpose_chars (int count, int key __attribute__((unused)))
int count, key;
{ {
#if defined (HANDLE_MULTIBYTE) #if defined (HANDLE_MULTIBYTE)
char *dummy; char *dummy;
@ -1486,15 +1474,13 @@ _rl_char_search (count, fdir, bdir)
#endif /* !HANDLE_MULTIBYTE */ #endif /* !HANDLE_MULTIBYTE */
int int
rl_char_search (count, key) rl_char_search (int count, int key __attribute__((unused)))
int count, key;
{ {
return (_rl_char_search (count, FFIND, BFIND)); return (_rl_char_search (count, FFIND, BFIND));
} }
int int
rl_backward_char_search (count, key) rl_backward_char_search (int count, int key __attribute__((unused)))
int count, key;
{ {
return (_rl_char_search (count, BFIND, FFIND)); return (_rl_char_search (count, BFIND, FFIND));
} }
@ -1519,16 +1505,15 @@ _rl_set_mark_at_pos (position)
/* A bindable command to set the mark. */ /* A bindable command to set the mark. */
int int
rl_set_mark (count, key) rl_set_mark (int count, int key __attribute__((unused)))
int count, key;
{ {
return (_rl_set_mark_at_pos (rl_explicit_arg ? count : rl_point)); return (_rl_set_mark_at_pos (rl_explicit_arg ? count : rl_point));
} }
/* Exchange the position of mark and point. */ /* Exchange the position of mark and point. */
int int
rl_exchange_point_and_mark (count, key) rl_exchange_point_and_mark (int count __attribute__((unused)),
int count, key; int key __attribute__((unused)))
{ {
if (rl_mark > rl_end) if (rl_mark > rl_end)
rl_mark = -1; rl_mark = -1;

View File

@ -190,7 +190,7 @@ tilde_expand (string)
int result_size, result_index; int result_size, result_index;
result_index = result_size = 0; result_index = result_size = 0;
if (result = strchr (string, '~')) if ((result = strchr (string, '~')))
result = (char *)xmalloc (result_size = (strlen (string) + 16)); result = (char *)xmalloc (result_size = (strlen (string) + 16));
else else
result = (char *)xmalloc (result_size = (strlen (string) + 1)); result = (char *)xmalloc (result_size = (strlen (string) + 1));

View File

@ -175,7 +175,7 @@ _rl_fix_last_undo_of_type (type, start, end)
for (rl = rl_undo_list; rl; rl = rl->next) for (rl = rl_undo_list; rl; rl = rl->next)
{ {
if (rl->what == type) if (rl->what == (uint) type)
{ {
rl->start = start; rl->start = start;
rl->end = end; rl->end = end;
@ -226,8 +226,7 @@ rl_modifying (start, end)
/* Revert the current line to its previous state. */ /* Revert the current line to its previous state. */
int int
rl_revert_line (count, key) rl_revert_line (int count __attribute__((unused)), int key __attribute__((unused)))
int count, key;
{ {
if (!rl_undo_list) if (!rl_undo_list)
rl_ding (); rl_ding ();
@ -241,8 +240,7 @@ rl_revert_line (count, key)
/* Do some undoing of things that were done. */ /* Do some undoing of things that were done. */
int int
rl_undo_command (count, key) rl_undo_command (int count, int key __attribute__((unused)))
int count, key;
{ {
if (count < 0) if (count < 0)
return 0; /* Nothing to do. */ return 0; /* Nothing to do. */

View File

@ -95,15 +95,13 @@ _rl_abort_internal ()
} }
int int
rl_abort (count, key) rl_abort (int count __attribute__((unused)), int key __attribute__((unused)))
int count, key;
{ {
return (_rl_abort_internal ()); return (_rl_abort_internal ());
} }
int int
rl_tty_status (count, key) rl_tty_status (int count __attribute__((unused)), int key __attribute__((unused)))
int count, key;
{ {
#if defined (TIOCSTAT) #if defined (TIOCSTAT)
ioctl (1, TIOCSTAT, (char *)0); ioctl (1, TIOCSTAT, (char *)0);
@ -152,8 +150,7 @@ rl_extend_line_buffer (len)
/* A function for simple tilde expansion. */ /* A function for simple tilde expansion. */
int int
rl_tilde_expand (ignore, key) rl_tilde_expand (int ignore __attribute__((unused)), int key __attribute__((unused)))
int ignore, key;
{ {
register int start, end; register int start, end;
char *homedir, *temp; char *homedir, *temp;

View File

@ -112,7 +112,7 @@ _rl_vi_initialize_line ()
{ {
register int i; register int i;
for (i = 0; i < sizeof (vi_mark_chars) / sizeof (int); i++) for (i = 0; i < (int) (sizeof (vi_mark_chars) / sizeof (int)); i++)
vi_mark_chars[i] = -1; vi_mark_chars[i] = -1;
} }
@ -166,8 +166,7 @@ _rl_vi_stuff_insert (count)
redo a text modification command. The default for _rl_vi_last_command redo a text modification command. The default for _rl_vi_last_command
puts you back into insert mode. */ puts you back into insert mode. */
int int
rl_vi_redo (count, c) rl_vi_redo (int count, int c __attribute__((unused)))
int count, c;
{ {
int r; int r;
@ -205,8 +204,7 @@ rl_vi_undo (count, key)
/* Yank the nth arg from the previous line into this line at point. */ /* Yank the nth arg from the previous line into this line at point. */
int int
rl_vi_yank_arg (count, key) rl_vi_yank_arg (int count, int key __attribute__((unused)))
int count, key;
{ {
/* Readline thinks that the first word on a line is the 0th, while vi /* Readline thinks that the first word on a line is the 0th, while vi
thinks the first word on a line is the 1st. Compensate. */ thinks the first word on a line is the 1st. Compensate. */
@ -286,8 +284,7 @@ rl_vi_search (count, key)
/* Completion, from vi's point of view. */ /* Completion, from vi's point of view. */
int int
rl_vi_complete (ignore, key) rl_vi_complete (int ignore __attribute__((unused)), int key)
int ignore, key;
{ {
if ((rl_point < rl_end) && (!whitespace (rl_line_buffer[rl_point]))) if ((rl_point < rl_end) && (!whitespace (rl_line_buffer[rl_point])))
{ {
@ -313,8 +310,7 @@ rl_vi_complete (ignore, key)
/* Tilde expansion for vi mode. */ /* Tilde expansion for vi mode. */
int int
rl_vi_tilde_expand (ignore, key) rl_vi_tilde_expand (int ignore __attribute__((unused)), int key)
int ignore, key;
{ {
rl_tilde_expand (0, key); rl_tilde_expand (0, key);
rl_vi_start_inserting (key, 1, rl_arg_sign); rl_vi_start_inserting (key, 1, rl_arg_sign);
@ -384,8 +380,7 @@ rl_vi_end_word (count, key)
/* Move forward a word the way that 'W' does. */ /* Move forward a word the way that 'W' does. */
int int
rl_vi_fWord (count, ignore) rl_vi_fWord (int count, int ignore __attribute__((unused)))
int count, ignore;
{ {
while (count-- && rl_point < (rl_end - 1)) while (count-- && rl_point < (rl_end - 1))
{ {
@ -401,8 +396,7 @@ rl_vi_fWord (count, ignore)
} }
int int
rl_vi_bWord (count, ignore) rl_vi_bWord (int count, int ignore __attribute__((unused)))
int count, ignore;
{ {
while (count-- && rl_point > 0) while (count-- && rl_point > 0)
{ {
@ -425,8 +419,7 @@ rl_vi_bWord (count, ignore)
} }
int int
rl_vi_eWord (count, ignore) rl_vi_eWord(int count, int ignore __attribute__((unused)))
int count, ignore;
{ {
while (count-- && rl_point < (rl_end - 1)) while (count-- && rl_point < (rl_end - 1))
{ {
@ -456,8 +449,7 @@ rl_vi_eWord (count, ignore)
} }
int int
rl_vi_fword (count, ignore) rl_vi_fword (int count, int ignore __attribute__((unused)))
int count, ignore;
{ {
while (count-- && rl_point < (rl_end - 1)) while (count-- && rl_point < (rl_end - 1))
{ {
@ -482,8 +474,7 @@ rl_vi_fword (count, ignore)
} }
int int
rl_vi_bword (count, ignore) rl_vi_bword (int count, int ignore __attribute__((unused)))
int count, ignore;
{ {
while (count-- && rl_point > 0) while (count-- && rl_point > 0)
{ {
@ -521,8 +512,7 @@ rl_vi_bword (count, ignore)
} }
int int
rl_vi_eword (count, ignore) rl_vi_eword (int count, int ignore __attribute__((unused)))
int count, ignore;
{ {
while (count-- && rl_point < rl_end - 1) while (count-- && rl_point < rl_end - 1)
{ {
@ -546,8 +536,7 @@ rl_vi_eword (count, ignore)
} }
int int
rl_vi_insert_beg (count, key) rl_vi_insert_beg (int count __attribute__((unused)), int key)
int count, key;
{ {
rl_beg_of_line (1, key); rl_beg_of_line (1, key);
rl_vi_insertion_mode (1, key); rl_vi_insertion_mode (1, key);
@ -555,8 +544,7 @@ rl_vi_insert_beg (count, key)
} }
int int
rl_vi_append_mode (count, key) rl_vi_append_mode (int count __attribute__((unused)), int key)
int count, key;
{ {
if (rl_point < rl_end) if (rl_point < rl_end)
{ {
@ -575,8 +563,7 @@ rl_vi_append_mode (count, key)
} }
int int
rl_vi_append_eol (count, key) rl_vi_append_eol (int count __attribute__((unused)), int key)
int count, key;
{ {
rl_end_of_line (1, key); rl_end_of_line (1, key);
rl_vi_append_mode (1, key); rl_vi_append_mode (1, key);
@ -585,8 +572,7 @@ rl_vi_append_eol (count, key)
/* What to do in the case of C-d. */ /* What to do in the case of C-d. */
int int
rl_vi_eof_maybe (count, c) rl_vi_eof_maybe (int count __attribute__((unused)), int c __attribute__((unused)))
int count, c;
{ {
return (rl_newline (1, '\n')); return (rl_newline (1, '\n'));
} }
@ -596,8 +582,7 @@ rl_vi_eof_maybe (count, c)
/* Switching from one mode to the other really just involves /* Switching from one mode to the other really just involves
switching keymaps. */ switching keymaps. */
int int
rl_vi_insertion_mode (count, key) rl_vi_insertion_mode (int count __attribute__((unused)), int key)
int count, key;
{ {
_rl_keymap = vi_insertion_keymap; _rl_keymap = vi_insertion_keymap;
_rl_vi_last_key_before_insert = key; _rl_vi_last_key_before_insert = key;
@ -659,8 +644,7 @@ _rl_vi_done_inserting ()
} }
int int
rl_vi_movement_mode (count, key) rl_vi_movement_mode (int count __attribute__((unused)), int key)
int count, key;
{ {
if (rl_point > 0) if (rl_point > 0)
rl_backward_char (1, key); rl_backward_char (1, key);
@ -729,8 +713,7 @@ _rl_vi_change_mbchar_case (count)
#endif #endif
int int
rl_vi_change_case (count, ignore) rl_vi_change_case (int count, int ignore __attribute__((unused)))
int count, ignore;
{ {
int c, p; int c, p;
@ -959,8 +942,7 @@ rl_digit_loop1 ()
} }
int int
rl_vi_delete_to (count, key) rl_vi_delete_to (int count __attribute__((unused)), int key)
int count, key;
{ {
int c; int c;
@ -985,8 +967,7 @@ rl_vi_delete_to (count, key)
} }
int int
rl_vi_change_to (count, key) rl_vi_change_to (int count __attribute__((unused)), int key)
int count, key;
{ {
int c, start_pos; int c, start_pos;
@ -1038,8 +1019,7 @@ rl_vi_change_to (count, key)
} }
int int
rl_vi_yank_to (count, key) rl_vi_yank_to (int count __attribute__((unused)), int key)
int count, key;
{ {
int c, save = rl_point; int c, save = rl_point;
@ -1094,8 +1074,7 @@ rl_vi_delete (count, key)
} }
int int
rl_vi_back_to_indent (count, key) rl_vi_back_to_indent (int count __attribute__((unused)), int key)
int count, key;
{ {
rl_beg_of_line (1, key); rl_beg_of_line (1, key);
while (rl_point < rl_end && whitespace (rl_line_buffer[rl_point])) while (rl_point < rl_end && whitespace (rl_line_buffer[rl_point]))
@ -1104,8 +1083,7 @@ rl_vi_back_to_indent (count, key)
} }
int int
rl_vi_first_print (count, key) rl_vi_first_print (int count __attribute__((unused)), int key)
int count, key;
{ {
return (rl_vi_back_to_indent (1, key)); return (rl_vi_back_to_indent (1, key));
} }
@ -1173,8 +1151,7 @@ rl_vi_char_search (count, key)
/* Match brackets */ /* Match brackets */
int int
rl_vi_match (ignore, key) rl_vi_match (int ignore __attribute__((unused)), int key)
int ignore, key;
{ {
int count = 1, brack, pos, tmp, pre; int count = 1, brack, pos, tmp, pre;
@ -1284,8 +1261,7 @@ rl_vi_bracktype (c)
for test against 033 or ^C. Make sure that _rl_read_mbchar does for test against 033 or ^C. Make sure that _rl_read_mbchar does
this right. */ this right. */
int int
rl_vi_change_char (count, key) rl_vi_change_char (int count, int key __attribute__((unused)))
int count, key;
{ {
int c, p; int c, p;
@ -1389,8 +1365,7 @@ rl_vi_overstrike_delete (count, key)
} }
int int
rl_vi_replace (count, key) rl_vi_replace (int count __attribute__((unused)), int key __attribute__((unused)))
int count, key;
{ {
int i; int i;
@ -1450,8 +1425,7 @@ rl_vi_possible_completions()
/* Functions to save and restore marks. */ /* Functions to save and restore marks. */
int int
rl_vi_set_mark (count, key) rl_vi_set_mark (int count __attribute__((unused)), int key __attribute__((unused)))
int count, key;
{ {
int ch; int ch;
@ -1470,8 +1444,7 @@ rl_vi_set_mark (count, key)
} }
int int
rl_vi_goto_mark (count, key) rl_vi_goto_mark (int count __attribute__((unused)), int key __attribute__((unused)))
int count, key;
{ {
int ch; int ch;

View File

@ -169,7 +169,7 @@ register unsigned long *child_time;
*name_pos = temp->pos; *name_pos = temp->pos;
*time_entered = temp->time; *time_entered = temp->time;
*child_time = temp->children; *child_time = temp->children;
DBUG_PRINT ("pop", ("%d %d %d",*name_pos,*time_entered,*child_time)); DBUG_PRINT ("pop", ("%d %lu %lu",*name_pos,*time_entered,*child_time));
rtnval = stacktop--; rtnval = stacktop--;
} }
DBUG_RETURN (rtnval); DBUG_RETURN (rtnval);
@ -334,12 +334,12 @@ FILE *inf;
* function is found on the stack. * function is found on the stack.
*/ */
while (pop (&oldpos, &oldtime, &oldchild)) { while (pop (&oldpos, &oldtime, &oldchild)) {
DBUG_PRINT ("popped", ("%d %d", oldtime, oldchild)); DBUG_PRINT ("popped", ("%lu %lu", oldtime, oldchild));
time = fn_time - oldtime; time = fn_time - oldtime;
t = top (); t = top ();
t -> children += time; t -> children += time;
DBUG_PRINT ("update", ("%s", modules[t -> pos].name)); DBUG_PRINT ("update", ("%s", modules[t -> pos].name));
DBUG_PRINT ("update", ("%d", t -> children)); DBUG_PRINT ("update", ("%lu", t -> children));
time -= oldchild; time -= oldchild;
modules[oldpos].m_time += time; modules[oldpos].m_time += time;
modules[oldpos].m_calls++; modules[oldpos].m_calls++;
@ -520,19 +520,19 @@ register unsigned long int *s_calls, *s_time;
unsigned long int calls, time; unsigned long int calls, time;
DBUG_ENTER ("out_body"); DBUG_ENTER ("out_body");
DBUG_PRINT ("out_body", ("%d,%d",*s_calls,*s_time)); DBUG_PRINT ("out_body", ("%lu,%lu",*s_calls,*s_time));
if (root == MAXPROCS) { if (root == MAXPROCS) {
DBUG_PRINT ("out_body", ("%d,%d",*s_calls,*s_time)); DBUG_PRINT ("out_body", ("%lu,%lu",*s_calls,*s_time));
} else { } else {
while (root != MAXPROCS) { while (root != MAXPROCS) {
out_body (outf, s_table[root].lchild,s_calls,s_time); out_body (outf, s_table[root].lchild,s_calls,s_time);
out_item (outf, &modules[s_table[root].pos],&calls,&time); out_item (outf, &modules[s_table[root].pos],&calls,&time);
DBUG_PRINT ("out_body", ("-- %d -- %d --", calls, time)); DBUG_PRINT ("out_body", ("-- %lu -- %lu --", calls, time));
*s_calls += calls; *s_calls += calls;
*s_time += time; *s_time += time;
root = s_table[root].rchild; root = s_table[root].rchild;
} }
DBUG_PRINT ("out_body", ("%d,%d", *s_calls, *s_time)); DBUG_PRINT ("out_body", ("%lu,%lu", *s_calls, *s_time));
} }
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }

View File

@ -918,7 +918,7 @@ void ERR_print_errors_fp(FILE* /*fp*/)
char* ERR_error_string(unsigned long errNumber, char* buffer) char* ERR_error_string(unsigned long errNumber, char* buffer)
{ {
static char* msg = "Please supply a buffer for error string"; static char* msg = (char*) "Please supply a buffer for error string";
if (buffer) { if (buffer) {
SetErrorString(YasslError(errNumber), buffer); SetErrorString(YasslError(errNumber), buffer);

View File

@ -86,8 +86,8 @@ int main(int argc, char** argv)
// input output compare // input output compare
byte input[TaoCrypt::MD5::DIGEST_SIZE]; byte input[TaoCrypt::MD5::DIGEST_SIZE];
byte output[TaoCrypt::MD5::DIGEST_SIZE]; byte output[TaoCrypt::MD5::DIGEST_SIZE];
file_test("input", input); file_test((char*) "input", input);
file_test("output", output); file_test((char*) "output", output);
assert(memcmp(input, output, sizeof(input)) == 0); assert(memcmp(input, output, sizeof(input)) == 0);
printf("\nAll tests passed!\n"); printf("\nAll tests passed!\n");

View File

@ -2093,7 +2093,7 @@ mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, ulong length)
} }
stmt->bind= stmt->params + stmt->param_count; stmt->bind= stmt->params + stmt->param_count;
stmt->state= MYSQL_STMT_PREPARE_DONE; stmt->state= MYSQL_STMT_PREPARE_DONE;
DBUG_PRINT("info", ("Parameter count: %ld", stmt->param_count)); DBUG_PRINT("info", ("Parameter count: %u", stmt->param_count));
DBUG_RETURN(0); DBUG_RETURN(0);
} }
@ -2436,10 +2436,10 @@ static my_bool store_param(MYSQL_STMT *stmt, MYSQL_BIND *param)
{ {
NET *net= &stmt->mysql->net; NET *net= &stmt->mysql->net;
DBUG_ENTER("store_param"); DBUG_ENTER("store_param");
DBUG_PRINT("enter",("type: %d, buffer:%lx, length: %lu is_null: %d", DBUG_PRINT("enter",("type: %d buffer: 0x%lx length: %lu is_null: %d",
param->buffer_type, param->buffer_type,
param->buffer ? param->buffer : "0", *param->length, (long) (param->buffer ? param->buffer : NullS),
*param->is_null)); *param->length, *param->is_null));
if (*param->is_null) if (*param->is_null)
store_param_null(net, param); store_param_null(net, param);
@ -3318,8 +3318,8 @@ mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number,
MYSQL_BIND *param; MYSQL_BIND *param;
DBUG_ENTER("mysql_stmt_send_long_data"); DBUG_ENTER("mysql_stmt_send_long_data");
DBUG_ASSERT(stmt != 0); DBUG_ASSERT(stmt != 0);
DBUG_PRINT("enter",("param no : %d, data : %lx, length : %ld", DBUG_PRINT("enter",("param no: %d data: 0x%lx, length : %ld",
param_number, data, length)); param_number, (long) data, length));
/* /*
We only need to check for stmt->param_count, if it's not null We only need to check for stmt->param_count, if it's not null
@ -4402,7 +4402,7 @@ my_bool STDCALL mysql_stmt_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *bind)
ulong bind_count= stmt->field_count; ulong bind_count= stmt->field_count;
uint param_count= 0; uint param_count= 0;
DBUG_ENTER("mysql_stmt_bind_result"); DBUG_ENTER("mysql_stmt_bind_result");
DBUG_PRINT("enter",("field_count: %d", bind_count)); DBUG_PRINT("enter",("field_count: %lu", bind_count));
if (!bind_count) if (!bind_count)
{ {

View File

@ -206,7 +206,7 @@ mysql_real_connect(MYSQL *mysql,const char *host, const char *user,
} }
} }
DBUG_PRINT("exit",("Mysql handler: %lx",mysql)); DBUG_PRINT("exit",("Mysql handler: 0x%lx", (long) mysql));
DBUG_RETURN(mysql); DBUG_RETURN(mysql);
error: error:

View File

@ -5,7 +5,7 @@ source ./include/master-slave.inc;
# remote table creation # remote table creation
connection slave; connection slave;
--replicate-ignore-db=federated #--replicate-ignore-db=federated
stop slave; stop slave;
--disable_warnings --disable_warnings

View File

@ -1,6 +1,6 @@
delimiter |; delimiter |;
--------------------------------------------------------------------------- # --------------------------------------------------------------------------
CREATE PROCEDURE sp_vars_check_dflt() CREATE PROCEDURE sp_vars_check_dflt()
BEGIN BEGIN
@ -40,7 +40,7 @@ BEGIN
SELECT v17, v18, v19, v20; SELECT v17, v18, v19, v20;
END| END|
--------------------------------------------------------------------------- # --------------------------------------------------------------------------
CREATE PROCEDURE sp_vars_check_assignment() CREATE PROCEDURE sp_vars_check_assignment()
BEGIN BEGIN
@ -89,35 +89,35 @@ BEGIN
SELECT d1, d2, d3; SELECT d1, d2, d3;
END| END|
--------------------------------------------------------------------------- # --------------------------------------------------------------------------
CREATE FUNCTION sp_vars_check_ret1() RETURNS TINYINT CREATE FUNCTION sp_vars_check_ret1() RETURNS TINYINT
BEGIN BEGIN
RETURN 1e200; RETURN 1e200;
END| END|
--------------------------------------------------------------------------- # --------------------------------------------------------------------------
CREATE FUNCTION sp_vars_check_ret2() RETURNS TINYINT CREATE FUNCTION sp_vars_check_ret2() RETURNS TINYINT
BEGIN BEGIN
RETURN 10 * 10 * 10; RETURN 10 * 10 * 10;
END| END|
--------------------------------------------------------------------------- # --------------------------------------------------------------------------
CREATE FUNCTION sp_vars_check_ret3() RETURNS TINYINT CREATE FUNCTION sp_vars_check_ret3() RETURNS TINYINT
BEGIN BEGIN
RETURN 'Hello, world'; RETURN 'Hello, world';
END| END|
--------------------------------------------------------------------------- # --------------------------------------------------------------------------
CREATE FUNCTION sp_vars_check_ret4() RETURNS DECIMAL(64, 2) CREATE FUNCTION sp_vars_check_ret4() RETURNS DECIMAL(64, 2)
BEGIN BEGIN
RETURN 12 * 10 + 34 + 0.1234; RETURN 12 * 10 + 34 + 0.1234;
END| END|
--------------------------------------------------------------------------- # --------------------------------------------------------------------------
CREATE FUNCTION sp_vars_div_zero() RETURNS INTEGER CREATE FUNCTION sp_vars_div_zero() RETURNS INTEGER
BEGIN BEGIN
@ -126,6 +126,6 @@ BEGIN
RETURN div_zero; RETURN div_zero;
END| END|
--------------------------------------------------------------------------- # --------------------------------------------------------------------------
delimiter ;| delimiter ;|

View File

@ -188,19 +188,14 @@ if [ -d ./sql ] ; then
SOURCE_DIST=1 SOURCE_DIST=1
else else
BINARY_DIST=1 BINARY_DIST=1
fi
# ... one level for tar.gz, two levels for a RPM installation # ... one level for tar.gz, two levels for a RPM installation
if [ -d ./bin ] ; then if [ ! -f ./bin/mysql_upgrade ] ; then
# this is not perfect: we have # Has to be RPM installation
# /usr/share/mysql/ # mysql-test-run is here, so this is "$MYSQL_TEST_DIR"
# /usr/bin/ # with MySQL client programs
# so the existence of "/usr/share/bin/" would make this test fail.
BASEDIR=`pwd`
else
cd .. cd ..
BASEDIR=`pwd` fi
fi fi
BASEDIR=`pwd`
cd $MYSQL_TEST_DIR cd $MYSQL_TEST_DIR
MYSQL_TEST_WINDIR=$MYSQL_TEST_DIR MYSQL_TEST_WINDIR=$MYSQL_TEST_DIR
@ -2188,6 +2183,9 @@ then
$RM -f $MASTER_MYDDIR/log.* $RM -f $MASTER_MYDDIR/log.*
$RM -f $MASTER_MYDDIR"1"/log.* $RM -f $MASTER_MYDDIR"1"/log.*
# Remove old log and reject files
$RM -f r/*.reject r/*.progress r/*.log r/*.warnings
wait_for_master=$SLEEP_TIME_FOR_FIRST_MASTER wait_for_master=$SLEEP_TIME_FOR_FIRST_MASTER
wait_for_slave=$SLEEP_TIME_FOR_FIRST_SLAVE wait_for_slave=$SLEEP_TIME_FOR_FIRST_SLAVE
$ECHO "Installing Test Databases" $ECHO "Installing Test Databases"

View File

@ -2045,6 +2045,12 @@ sub cleanup_stale_files () {
} }
closedir(DIR); closedir(DIR);
} }
# Remove old log files
foreach my $name (glob("r/*.reject r/*.progress r/*.log r/*.warnings"))
{
unlink($name);
}
} }
@ -2426,7 +2432,7 @@ sub ndbcluster_start ($$) {
sub rm_ndbcluster_tables ($) { sub rm_ndbcluster_tables ($) {
my $dir= shift; my $dir= shift;
foreach my $bin ( glob("$dir/mysql/apply_status*"), foreach my $bin ( glob("$dir/mysql/apply_status*"),
glob("$dir/mysql/schema*") ) glob("$dir/mysql/schema*"))
{ {
unlink($bin); unlink($bin);
} }

View File

@ -1,4 +1,4 @@
drop table if exists t1; DROP TABLE IF EXISTS t1;
SHOW COLLATION LIKE 'cp1250_czech_cs'; SHOW COLLATION LIKE 'cp1250_czech_cs';
Collation Charset Id Default Compiled Sortlen Collation Charset Id Default Compiled Sortlen
cp1250_czech_cs cp1250 34 Yes 2 cp1250_czech_cs cp1250 34 Yes 2

View File

@ -554,7 +554,7 @@ create table t1 (
a varchar(112) charset utf8 collate utf8_bin not null, a varchar(112) charset utf8 collate utf8_bin not null,
primary key (a) primary key (a)
) select 'test' as a ; ) select 'test' as a ;
--warning 1364 #--warning 1364
show create table t1; show create table t1;
drop table t1; drop table t1;
@ -567,7 +567,7 @@ CREATE TABLE t2 (
); );
insert into t2 values(111); insert into t2 values(111);
--warning 1364 #--warning 1364
create table t1 ( create table t1 (
a varchar(12) charset utf8 collate utf8_bin not null, a varchar(12) charset utf8 collate utf8_bin not null,
b int not null, primary key (a) b int not null, primary key (a)
@ -575,7 +575,7 @@ create table t1 (
show create table t1; show create table t1;
drop table t1; drop table t1;
--warning 1364 #--warning 1364
create table t1 ( create table t1 (
a varchar(12) charset utf8 collate utf8_bin not null, a varchar(12) charset utf8 collate utf8_bin not null,
b int not null, primary key (a) b int not null, primary key (a)
@ -583,7 +583,7 @@ create table t1 (
show create table t1; show create table t1;
drop table t1; drop table t1;
--warning 1364 #--warning 1364
create table t1 ( create table t1 (
a varchar(12) charset utf8 collate utf8_bin not null, a varchar(12) charset utf8 collate utf8_bin not null,
b int null, primary key (a) b int null, primary key (a)
@ -591,7 +591,7 @@ create table t1 (
show create table t1; show create table t1;
drop table t1; drop table t1;
--warning 1364 #--warning 1364
create table t1 ( create table t1 (
a varchar(12) charset utf8 collate utf8_bin not null, a varchar(12) charset utf8 collate utf8_bin not null,
b int not null, primary key (a) b int not null, primary key (a)
@ -599,7 +599,7 @@ create table t1 (
show create table t1; show create table t1;
drop table t1; drop table t1;
--warning 1364 #--warning 1364
create table t1 ( create table t1 (
a varchar(12) charset utf8 collate utf8_bin, a varchar(12) charset utf8 collate utf8_bin,
b int not null, primary key (a) b int not null, primary key (a)
@ -613,7 +613,7 @@ create table t1 (
); );
insert into t1 values (1,1,1, 1,1,1, 1,1,1); insert into t1 values (1,1,1, 1,1,1, 1,1,1);
--warning 1364 #--warning 1364
create table t2 ( create table t2 (
a1 varchar(12) charset utf8 collate utf8_bin not null, a1 varchar(12) charset utf8 collate utf8_bin not null,
a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int, a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int,
@ -621,20 +621,20 @@ create table t2 (
) select a1,a2,a3,a4,a5,a6,a7,a8,a9 from t1 ; ) select a1,a2,a3,a4,a5,a6,a7,a8,a9 from t1 ;
drop table t2; drop table t2;
--warning 1364 #--warning 1364
create table t2 ( create table t2 (
a1 varchar(12) charset utf8 collate utf8_bin, a1 varchar(12) charset utf8 collate utf8_bin,
a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int
) select a1,a2,a3,a4,a5,a6,a7,a8,a9 from t1; ) select a1,a2,a3,a4,a5,a6,a7,a8,a9 from t1;
drop table t1, t2; drop table t1, t2;
--warning 1364 #--warning 1364
create table t1 ( create table t1 (
a1 int, a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int a1 int, a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int
); );
insert into t1 values (1,1,1, 1,1,1, 1,1,1); insert into t1 values (1,1,1, 1,1,1, 1,1,1);
--warning 1364 #--warning 1364
create table t2 ( create table t2 (
a1 varchar(12) charset utf8 collate utf8_bin not null, a1 varchar(12) charset utf8 collate utf8_bin not null,
a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int, a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int,

View File

@ -1508,27 +1508,27 @@ DROP TABLE test_repair_table5;
create table t1 (a int) engine=csv; create table t1 (a int) engine=csv;
insert t1 values (1); insert t1 values (1);
--enable_info --enable_info
delete from t1; -- delete_row delete from t1; # delete_row
delete from t1; -- delete_all_rows delete from t1; # delete_all_rows
--disable_info --disable_info
insert t1 values (1),(2); insert t1 values (1),(2);
--enable_info --enable_info
delete from t1; -- delete_all_rows delete from t1; # delete_all_rows
--disable_info --disable_info
insert t1 values (1),(2),(3); insert t1 values (1),(2),(3);
flush tables; flush tables;
--enable_info --enable_info
delete from t1; -- delete_row delete from t1; # delete_row
--disable_info --disable_info
insert t1 values (1),(2),(3),(4); insert t1 values (1),(2),(3),(4);
flush tables; flush tables;
select count(*) from t1; select count(*) from t1;
--enable_info --enable_info
delete from t1; -- delete_all_rows delete from t1; # delete_all_rows
--disable_info --disable_info
insert t1 values (1),(2),(3),(4),(5); insert t1 values (1),(2),(3),(4),(5);
--enable_info --enable_info
truncate table t1; -- truncate truncate table t1; # truncate
--disable_info --disable_info
drop table t1; drop table t1;

View File

@ -59,7 +59,7 @@ INSERT INTO t1 (latin1_f) VALUES (_latin1'Z');
INSERT INTO t1 (latin1_f) VALUES (_latin1'z'); INSERT INTO t1 (latin1_f) VALUES (_latin1'z');
-- ORDER BY # ORDER BY
SELECT latin1_f FROM t1 ORDER BY latin1_f; SELECT latin1_f FROM t1 ORDER BY latin1_f;
SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_swedish_ci; SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_swedish_ci;
@ -69,9 +69,9 @@ SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_bin;
--error 1253 --error 1253
SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE koi8r_general_ci; SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE koi8r_general_ci;
--SELECT latin1_f COLLATE koi8r FROM t1 ; # SELECT latin1_f COLLATE koi8r FROM t1 ;
-- AS + ORDER BY # AS + ORDER BY
SELECT latin1_f COLLATE latin1_swedish_ci AS latin1_f_as FROM t1 ORDER BY latin1_f_as; SELECT latin1_f COLLATE latin1_swedish_ci AS latin1_f_as FROM t1 ORDER BY latin1_f_as;
SELECT latin1_f COLLATE latin1_german2_ci AS latin1_f_as FROM t1 ORDER BY latin1_f_as; SELECT latin1_f COLLATE latin1_german2_ci AS latin1_f_as FROM t1 ORDER BY latin1_f_as;
SELECT latin1_f COLLATE latin1_general_ci AS latin1_f_as FROM t1 ORDER BY latin1_f_as; SELECT latin1_f COLLATE latin1_general_ci AS latin1_f_as FROM t1 ORDER BY latin1_f_as;
@ -80,7 +80,7 @@ SELECT latin1_f COLLATE latin1_bin AS latin1_f_as FROM t1 ORDER BY latin1
SELECT latin1_f COLLATE koi8r_general_ci AS latin1_f_as FROM t1 ORDER BY latin1_f_as; SELECT latin1_f COLLATE koi8r_general_ci AS latin1_f_as FROM t1 ORDER BY latin1_f_as;
-- GROUP BY # GROUP BY
SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f; SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f;
SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_swedish_ci; SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_swedish_ci;
@ -91,7 +91,7 @@ SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE latin1_bin;
SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE koi8r_general_ci; SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f COLLATE koi8r_general_ci;
-- DISTINCT # DISTINCT
SELECT DISTINCT latin1_f FROM t1; SELECT DISTINCT latin1_f FROM t1;
SELECT DISTINCT latin1_f COLLATE latin1_swedish_ci FROM t1; SELECT DISTINCT latin1_f COLLATE latin1_swedish_ci FROM t1;
@ -102,21 +102,20 @@ SELECT DISTINCT latin1_f COLLATE latin1_bin FROM t1;
SELECT DISTINCT latin1_f COLLATE koi8r FROM t1; SELECT DISTINCT latin1_f COLLATE koi8r FROM t1;
-- Aggregates # Aggregates
--SELECT MAX(k COLLATE latin1_german2_ci)
--FROM t1
-- WHERE
--SELECT *
--FROM t1
--WHERE (_latin1'Mu"ller' COLLATE latin1_german2_ci) = k
--HAVING
--SELECT *
--FROM t1
--HAVING (_latin1'Mu"ller' COLLATE latin1_german2_ci) = k
--disable_parsing
SELECT MAX(k COLLATE latin1_german2_ci)
FROM t1
WHERE
SELECT *
FROM t1
WHERE (_latin1'Mu"ller' COLLATE latin1_german2_ci) = k
HAVING
SELECT *
FROM t1
HAVING (_latin1'Mu"ller' COLLATE latin1_german2_ci) = k;
--enable_parsing
# #
# Check that SHOW displays COLLATE clause # Check that SHOW displays COLLATE clause

View File

@ -3,6 +3,10 @@
drop table if exists t1; drop table if exists t1;
--enable_warnings --enable_warnings
--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings
SHOW COLLATION LIKE 'cp1250_czech_cs'; SHOW COLLATION LIKE 'cp1250_czech_cs';
# #

View File

@ -298,7 +298,7 @@ INSERT INTO t1 VALUES (0xA),(0xAA),(0xAAA),(0xAAAA),(0xAAAAA);
SELECT HEX(a) FROM t1; SELECT HEX(a) FROM t1;
DROP TABLE t1; DROP TABLE t1;
-- the same should be also done with enum and set # the same should be also done with enum and set
# #

View File

@ -35,7 +35,7 @@ SET @@SQL_MODE="ALLOW_INVALID_DATES";
select datediff("1997-11-31 23:59:59.000001","1997-12-31"); select datediff("1997-11-31 23:59:59.000001","1997-12-31");
SET @@SQL_MODE=""; SET @@SQL_MODE="";
-- This will give a warning # This will give a warning
select datediff("1997-11-31 23:59:59.000001","1997-12-31"); select datediff("1997-11-31 23:59:59.000001","1997-12-31");
select datediff("1997-11-30 23:59:59.000001",null); select datediff("1997-11-30 23:59:59.000001",null);

View File

@ -300,18 +300,26 @@ select POSITION(_latin1'B' COLLATE latin1_general_ci IN _latin1'abcd' COLLATE la
select POSITION(_latin1'B' IN _latin2'abcd'); select POSITION(_latin1'B' IN _latin2'abcd');
select FIND_IN_SET(_latin1'B',_latin1'a,b,c,d'); select FIND_IN_SET(_latin1'B',_latin1'a,b,c,d');
--fix this:
--select FIND_IN_SET(_latin1'B',_latin1'a,b,c,d' COLLATE latin1_bin); # fix this:
--select FIND_IN_SET(_latin1'B' COLLATE latin1_bin,_latin1'a,b,c,d'); --disable_parsing
select FIND_IN_SET(_latin1'B',_latin1'a,b,c,d' COLLATE latin1_bin);
select FIND_IN_SET(_latin1'B' COLLATE latin1_bin,_latin1'a,b,c,d');
--enable_parsing
--error 1267 --error 1267
select FIND_IN_SET(_latin1'B' COLLATE latin1_general_ci,_latin1'a,b,c,d' COLLATE latin1_bin); select FIND_IN_SET(_latin1'B' COLLATE latin1_general_ci,_latin1'a,b,c,d' COLLATE latin1_bin);
--error 1267 --error 1267
select FIND_IN_SET(_latin1'B',_latin2'a,b,c,d'); select FIND_IN_SET(_latin1'B',_latin2'a,b,c,d');
select SUBSTRING_INDEX(_latin1'abcdabcdabcd',_latin1'd',2); select SUBSTRING_INDEX(_latin1'abcdabcdabcd',_latin1'd',2);
--fix this:
--select SUBSTRING_INDEX(_latin1'abcdabcdabcd' COLLATE latin1_bin,_latin1'd',2); # fix this:
--select SUBSTRING_INDEX(_latin1'abcdabcdabcd',_latin1'd' COLLATE latin1_bin,2); --disable_parsing
select SUBSTRING_INDEX(_latin1'abcdabcdabcd' COLLATE latin1_bin,_latin1'd',2);
select SUBSTRING_INDEX(_latin1'abcdabcdabcd',_latin1'd' COLLATE latin1_bin,2);
--enable_parsing
--error 1267 --error 1267
select SUBSTRING_INDEX(_latin1'abcdabcdabcd',_latin2'd',2); select SUBSTRING_INDEX(_latin1'abcdabcdabcd',_latin2'd',2);
--error 1267 --error 1267

View File

@ -118,7 +118,7 @@ drop table t1;
# #
--error 1221 --error 1221
GRANT FILE on mysqltest.* to mysqltest_1@localhost; GRANT FILE on mysqltest.* to mysqltest_1@localhost;
select 1; -- To test that the previous command didn't cause problems select 1; # To test that the previous command didn't cause problems
# #
# Bug #4898: User privileges depending on ORDER BY Settings of table db # Bug #4898: User privileges depending on ORDER BY Settings of table db

View File

@ -140,18 +140,18 @@ insert into t7 values (21,2,3,4,5,6);
select @@optimizer_search_depth; select @@optimizer_search_depth;
select @@optimizer_prune_level; select @@optimizer_prune_level;
-- This value swithes back to the old implementation of 'find_best()' # This value swithes back to the old implementation of 'find_best()'
-- set optimizer_search_depth=63; - old (independent of the optimizer_prune_level) # set optimizer_search_depth=63; - old (independent of the optimizer_prune_level)
#
# These are the values for the parameters that control the greedy optimizer
# (total 6 combinations - 3 for optimizer_search_depth, 2 for optimizer_prune_level):
-- --
-- These are the values for the parameters that control the greedy optimizer # set optimizer_search_depth=0; - automatic
-- (total 6 combinations - 3 for optimizer_search_depth, 2 for optimizer_prune_level): # set optimizer_search_depth=1; - min
# set optimizer_search_depth=62; - max (default)
-- --
-- set optimizer_search_depth=0; - automatic # set optimizer_prune_level=0 - exhaustive;
-- set optimizer_search_depth=1; - min # set optimizer_prune_level=1 - heuristic; # default
-- set optimizer_search_depth=62; - max (default)
--
-- set optimizer_prune_level=0 - exhaustive;
-- set optimizer_prune_level=1 - heuristic; -- default
# #
@ -170,17 +170,17 @@ select @@optimizer_prune_level;
set optimizer_search_depth=63; set optimizer_search_depth=63;
select @@optimizer_search_depth; select @@optimizer_search_depth;
-- 6-table join, chain # 6-table join, chain
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71; explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
show status like 'Last_query_cost'; show status like 'Last_query_cost';
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71; explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
show status like 'Last_query_cost'; show status like 'Last_query_cost';
-- 6-table join, star # 6-table join, star
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
show status like 'Last_query_cost'; show status like 'Last_query_cost';
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
show status like 'Last_query_cost'; show status like 'Last_query_cost';
-- 6-table join, clique # 6-table join, clique
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
show status like 'Last_query_cost'; show status like 'Last_query_cost';
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
@ -195,17 +195,17 @@ select @@optimizer_prune_level;
set optimizer_search_depth=0; set optimizer_search_depth=0;
select @@optimizer_search_depth; select @@optimizer_search_depth;
-- 6-table join, chain # 6-table join, chain
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71; explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
show status like 'Last_query_cost'; show status like 'Last_query_cost';
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71; explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
show status like 'Last_query_cost'; show status like 'Last_query_cost';
-- 6-table join, star # 6-table join, star
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
show status like 'Last_query_cost'; show status like 'Last_query_cost';
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
show status like 'Last_query_cost'; show status like 'Last_query_cost';
-- 6-table join, clique # 6-table join, clique
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
show status like 'Last_query_cost'; show status like 'Last_query_cost';
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
@ -214,17 +214,17 @@ show status like 'Last_query_cost';
set optimizer_search_depth=1; set optimizer_search_depth=1;
select @@optimizer_search_depth; select @@optimizer_search_depth;
-- 6-table join, chain # 6-table join, chain
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71; explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
show status like 'Last_query_cost'; show status like 'Last_query_cost';
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71; explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
show status like 'Last_query_cost'; show status like 'Last_query_cost';
-- 6-table join, star # 6-table join, star
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
show status like 'Last_query_cost'; show status like 'Last_query_cost';
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
show status like 'Last_query_cost'; show status like 'Last_query_cost';
-- 6-table join, clique # 6-table join, clique
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
show status like 'Last_query_cost'; show status like 'Last_query_cost';
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
@ -233,17 +233,17 @@ show status like 'Last_query_cost';
set optimizer_search_depth=62; set optimizer_search_depth=62;
select @@optimizer_search_depth; select @@optimizer_search_depth;
-- 6-table join, chain # 6-table join, chain
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71; explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
show status like 'Last_query_cost'; show status like 'Last_query_cost';
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71; explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
show status like 'Last_query_cost'; show status like 'Last_query_cost';
-- 6-table join, star # 6-table join, star
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
show status like 'Last_query_cost'; show status like 'Last_query_cost';
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
show status like 'Last_query_cost'; show status like 'Last_query_cost';
-- 6-table join, clique # 6-table join, clique
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
show status like 'Last_query_cost'; show status like 'Last_query_cost';
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
@ -256,17 +256,17 @@ select @@optimizer_prune_level;
set optimizer_search_depth=0; set optimizer_search_depth=0;
select @@optimizer_search_depth; select @@optimizer_search_depth;
-- 6-table join, chain # 6-table join, chain
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71; explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
show status like 'Last_query_cost'; show status like 'Last_query_cost';
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71; explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
show status like 'Last_query_cost'; show status like 'Last_query_cost';
-- 6-table join, star # 6-table join, star
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
show status like 'Last_query_cost'; show status like 'Last_query_cost';
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
show status like 'Last_query_cost'; show status like 'Last_query_cost';
-- 6-table join, clique # 6-table join, clique
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
show status like 'Last_query_cost'; show status like 'Last_query_cost';
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
@ -275,17 +275,17 @@ show status like 'Last_query_cost';
set optimizer_search_depth=1; set optimizer_search_depth=1;
select @@optimizer_search_depth; select @@optimizer_search_depth;
-- 6-table join, chain # 6-table join, chain
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71; explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
show status like 'Last_query_cost'; show status like 'Last_query_cost';
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71; explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
show status like 'Last_query_cost'; show status like 'Last_query_cost';
-- 6-table join, star # 6-table join, star
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
show status like 'Last_query_cost'; show status like 'Last_query_cost';
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
show status like 'Last_query_cost'; show status like 'Last_query_cost';
-- 6-table join, clique # 6-table join, clique
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
show status like 'Last_query_cost'; show status like 'Last_query_cost';
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
@ -294,17 +294,17 @@ show status like 'Last_query_cost';
set optimizer_search_depth=62; set optimizer_search_depth=62;
select @@optimizer_search_depth; select @@optimizer_search_depth;
-- 6-table join, chain # 6-table join, chain
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71; explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
show status like 'Last_query_cost'; show status like 'Last_query_cost';
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71; explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71;
show status like 'Last_query_cost'; show status like 'Last_query_cost';
-- 6-table join, star # 6-table join, star
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
show status like 'Last_query_cost'; show status like 'Last_query_cost';
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71;
show status like 'Last_query_cost'; show status like 'Last_query_cost';
-- 6-table join, clique # 6-table join, clique
explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;
show status like 'Last_query_cost'; show status like 'Last_query_cost';
explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76;

View File

@ -57,8 +57,8 @@ create index idx_t1_1 on t1 (a1,a2,b,c);
create index idx_t1_2 on t1 (a1,a2,b); create index idx_t1_2 on t1 (a1,a2,b);
analyze table t1; analyze table t1;
-- t2 is the same as t1, but with some NULLs in the MIN/MAX column, and one more # t2 is the same as t1, but with some NULLs in the MIN/MAX column, and
-- nullable attribute # one more nullable attribute
--disable_warnings --disable_warnings
drop table if exists t2; drop table if exists t2;
@ -68,7 +68,7 @@ create table t2 (
a1 char(64), a2 char(64) not null, b char(16), c char(16), d char(16), dummy char(64) default ' ' a1 char(64), a2 char(64) not null, b char(16), c char(16), d char(16), dummy char(64) default ' '
); );
insert into t2 select * from t1; insert into t2 select * from t1;
-- add few rows with NULL's in the MIN/MAX column # add few rows with NULL's in the MIN/MAX column
insert into t2 (a1, a2, b, c, d) values insert into t2 (a1, a2, b, c, d) values
('a','a',NULL,'a777','xyz'),('a','a',NULL,'a888','xyz'),('a','a',NULL,'a999','xyz'), ('a','a',NULL,'a777','xyz'),('a','a',NULL,'a888','xyz'),('a','a',NULL,'a999','xyz'),
('a','a','a',NULL,'xyz'), ('a','a','a',NULL,'xyz'),
@ -92,10 +92,10 @@ create index idx_t2_1 on t2 (a1,a2,b,c);
create index idx_t2_2 on t2 (a1,a2,b); create index idx_t2_2 on t2 (a1,a2,b);
analyze table t2; analyze table t2;
-- Table t3 is the same as t1, but with smaller column lenghts. # Table t3 is the same as t1, but with smaller column lenghts.
-- This allows to test different branches of the cost computation procedure # This allows to test different branches of the cost computation procedure
-- when the number of keys per block are less than the number of keys in the # when the number of keys per block are less than the number of keys in the
-- sub-groups formed by predicates over non-group attributes. # sub-groups formed by predicates over non-group attributes.
--disable_warnings --disable_warnings
drop table if exists t3; drop table if exists t3;
@ -164,11 +164,11 @@ create index idx_t3_2 on t3 (a1,a2,b);
analyze table t3; analyze table t3;
-- #
-- Queries without a WHERE clause. These queries do not use ranges. # Queries without a WHERE clause. These queries do not use ranges.
-- #
-- plans # plans
explain select a1, min(a2) from t1 group by a1; explain select a1, min(a2) from t1 group by a1;
explain select a1, max(a2) from t1 group by a1; explain select a1, max(a2) from t1 group by a1;
explain select a1, min(a2), max(a2) from t1 group by a1; explain select a1, min(a2), max(a2) from t1 group by a1;
@ -176,31 +176,31 @@ explain select a1, a2, b, min(c), max(c) from t1 group by a1,a2,b;
explain select a1,a2,b,max(c),min(c) from t1 group by a1,a2,b; explain select a1,a2,b,max(c),min(c) from t1 group by a1,a2,b;
--replace_column 7 # 9 # --replace_column 7 # 9 #
explain select a1,a2,b,max(c),min(c) from t2 group by a1,a2,b; explain select a1,a2,b,max(c),min(c) from t2 group by a1,a2,b;
-- Select fields in different order # Select fields in different order
explain select min(a2), a1, max(a2), min(a2), a1 from t1 group by a1; explain select min(a2), a1, max(a2), min(a2), a1 from t1 group by a1;
explain select a1, b, min(c), a1, max(c), b, a2, max(c), max(c) from t1 group by a1, a2, b; explain select a1, b, min(c), a1, max(c), b, a2, max(c), max(c) from t1 group by a1, a2, b;
explain select min(a2) from t1 group by a1; explain select min(a2) from t1 group by a1;
explain select a2, min(c), max(c) from t1 group by a1,a2,b; explain select a2, min(c), max(c) from t1 group by a1,a2,b;
-- queries # queries
select a1, min(a2) from t1 group by a1; select a1, min(a2) from t1 group by a1;
select a1, max(a2) from t1 group by a1; select a1, max(a2) from t1 group by a1;
select a1, min(a2), max(a2) from t1 group by a1; select a1, min(a2), max(a2) from t1 group by a1;
select a1, a2, b, min(c), max(c) from t1 group by a1,a2,b; select a1, a2, b, min(c), max(c) from t1 group by a1,a2,b;
select a1,a2,b,max(c),min(c) from t1 group by a1,a2,b; select a1,a2,b,max(c),min(c) from t1 group by a1,a2,b;
select a1,a2,b,max(c),min(c) from t2 group by a1,a2,b; select a1,a2,b,max(c),min(c) from t2 group by a1,a2,b;
-- Select fields in different order # Select fields in different order
select min(a2), a1, max(a2), min(a2), a1 from t1 group by a1; select min(a2), a1, max(a2), min(a2), a1 from t1 group by a1;
select a1, b, min(c), a1, max(c), b, a2, max(c), max(c) from t1 group by a1, a2, b; select a1, b, min(c), a1, max(c), b, a2, max(c), max(c) from t1 group by a1, a2, b;
select min(a2) from t1 group by a1; select min(a2) from t1 group by a1;
select a2, min(c), max(c) from t1 group by a1,a2,b; select a2, min(c), max(c) from t1 group by a1,a2,b;
-- #
-- Queries with a where clause # Queries with a where clause
-- #
-- A) Preds only over the group 'A' attributes # A) Preds only over the group 'A' attributes
-- plans # plans
explain select a1,a2,b,min(c),max(c) from t1 where a1 < 'd' group by a1,a2,b; explain select a1,a2,b,min(c),max(c) from t1 where a1 < 'd' group by a1,a2,b;
explain select a1,a2,b,min(c),max(c) from t1 where a1 >= 'b' group by a1,a2,b; explain select a1,a2,b,min(c),max(c) from t1 where a1 >= 'b' group by a1,a2,b;
explain select a1,a2,b, max(c) from t1 where a1 >= 'c' or a1 < 'b' group by a1,a2,b; explain select a1,a2,b, max(c) from t1 where a1 >= 'c' or a1 < 'b' group by a1,a2,b;
@ -238,7 +238,7 @@ explain select a1,min(c),max(c) from t2 where a1 >= 'b' group by a1,a2,b;
--replace_column 9 # --replace_column 9 #
explain select a1, max(c) from t2 where a1 in ('a','b','d') group by a1,a2,b; explain select a1, max(c) from t2 where a1 in ('a','b','d') group by a1,a2,b;
-- queries # queries
select a1,a2,b,min(c),max(c) from t1 where a1 < 'd' group by a1,a2,b; select a1,a2,b,min(c),max(c) from t1 where a1 < 'd' group by a1,a2,b;
select a1,a2,b,min(c),max(c) from t1 where a1 >= 'b' group by a1,a2,b; select a1,a2,b,min(c),max(c) from t1 where a1 >= 'b' group by a1,a2,b;
select a1,a2,b, max(c) from t1 where a1 >= 'c' or a1 < 'b' group by a1,a2,b; select a1,a2,b, max(c) from t1 where a1 >= 'c' or a1 < 'b' group by a1,a2,b;
@ -264,8 +264,8 @@ select a1,a2,b,min(c),max(c) from t2 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or
select a1,min(c),max(c) from t2 where a1 >= 'b' group by a1,a2,b; select a1,min(c),max(c) from t2 where a1 >= 'b' group by a1,a2,b;
select a1, max(c) from t2 where a1 in ('a','b','d') group by a1,a2,b; select a1, max(c) from t2 where a1 in ('a','b','d') group by a1,a2,b;
-- B) Equalities only over the non-group 'B' attributes # B) Equalities only over the non-group 'B' attributes
-- plans # plans
explain select a1,a2,b,max(c),min(c) from t1 where (a2 = 'a') and (b = 'b') group by a1; explain select a1,a2,b,max(c),min(c) from t1 where (a2 = 'a') and (b = 'b') group by a1;
explain select a1,max(c),min(c) from t1 where (a2 = 'a') and (b = 'b') group by a1; explain select a1,max(c),min(c) from t1 where (a2 = 'a') and (b = 'b') group by a1;
explain select a1,a2,b, max(c) from t1 where (b = 'b') group by a1,a2; explain select a1,a2,b, max(c) from t1 where (b = 'b') group by a1,a2;
@ -278,11 +278,11 @@ explain select a1,a2,b, max(c) from t2 where (b = 'b') group by a1,a2;
explain select a1,a2,b,min(c),max(c) from t2 where (b = 'b') group by a1,a2; explain select a1,a2,b,min(c),max(c) from t2 where (b = 'b') group by a1,a2;
explain select a1,a2, max(c) from t2 where (b = 'b') group by a1,a2; explain select a1,a2, max(c) from t2 where (b = 'b') group by a1,a2;
-- these queries test case 2) in TRP_GROUP_MIN_MAX::update_cost() # these queries test case 2) in TRP_GROUP_MIN_MAX::update_cost()
explain select a1,a2,b,max(c),min(c) from t3 where (a2 = 'a') and (b = 'b') group by a1; explain select a1,a2,b,max(c),min(c) from t3 where (a2 = 'a') and (b = 'b') group by a1;
explain select a1,max(c),min(c) from t3 where (a2 = 'a') and (b = 'b') group by a1; explain select a1,max(c),min(c) from t3 where (a2 = 'a') and (b = 'b') group by a1;
-- queries # queries
select a1,a2,b,max(c),min(c) from t1 where (a2 = 'a') and (b = 'b') group by a1; select a1,a2,b,max(c),min(c) from t1 where (a2 = 'a') and (b = 'b') group by a1;
select a1,max(c),min(c) from t1 where (a2 = 'a') and (b = 'b') group by a1; select a1,max(c),min(c) from t1 where (a2 = 'a') and (b = 'b') group by a1;
select a1,a2,b, max(c) from t1 where (b = 'b') group by a1,a2; select a1,a2,b, max(c) from t1 where (b = 'b') group by a1,a2;
@ -295,20 +295,20 @@ select a1,a2,b, max(c) from t2 where (b = 'b') group by a1,a2;
select a1,a2,b,min(c),max(c) from t2 where (b = 'b') group by a1,a2; select a1,a2,b,min(c),max(c) from t2 where (b = 'b') group by a1,a2;
select a1,a2, max(c) from t2 where (b = 'b') group by a1,a2; select a1,a2, max(c) from t2 where (b = 'b') group by a1,a2;
-- these queries test case 2) in TRP_GROUP_MIN_MAX::update_cost() # these queries test case 2) in TRP_GROUP_MIN_MAX::update_cost()
select a1,a2,b,max(c),min(c) from t3 where (a2 = 'a') and (b = 'b') group by a1; select a1,a2,b,max(c),min(c) from t3 where (a2 = 'a') and (b = 'b') group by a1;
select a1,max(c),min(c) from t3 where (a2 = 'a') and (b = 'b') group by a1; select a1,max(c),min(c) from t3 where (a2 = 'a') and (b = 'b') group by a1;
-- IS NULL (makes sense for t2 only) # IS NULL (makes sense for t2 only)
-- plans # plans
explain select a1,a2,b,min(c) from t2 where (a2 = 'a') and b is NULL group by a1; explain select a1,a2,b,min(c) from t2 where (a2 = 'a') and b is NULL group by a1;
explain select a1,a2,b,max(c) from t2 where (a2 = 'a') and b is NULL group by a1; explain select a1,a2,b,max(c) from t2 where (a2 = 'a') and b is NULL group by a1;
explain select a1,a2,b,min(c) from t2 where b is NULL group by a1,a2; explain select a1,a2,b,min(c) from t2 where b is NULL group by a1,a2;
explain select a1,a2,b,max(c) from t2 where b is NULL group by a1,a2; explain select a1,a2,b,max(c) from t2 where b is NULL group by a1,a2;
explain select a1,a2,b,min(c),max(c) from t2 where b is NULL group by a1,a2; explain select a1,a2,b,min(c),max(c) from t2 where b is NULL group by a1,a2;
explain select a1,a2,b,min(c),max(c) from t2 where b is NULL group by a1,a2; explain select a1,a2,b,min(c),max(c) from t2 where b is NULL group by a1,a2;
-- queries # queries
select a1,a2,b,min(c) from t2 where (a2 = 'a') and b is NULL group by a1; select a1,a2,b,min(c) from t2 where (a2 = 'a') and b is NULL group by a1;
select a1,a2,b,max(c) from t2 where (a2 = 'a') and b is NULL group by a1; select a1,a2,b,max(c) from t2 where (a2 = 'a') and b is NULL group by a1;
select a1,a2,b,min(c) from t2 where b is NULL group by a1,a2; select a1,a2,b,min(c) from t2 where b is NULL group by a1,a2;
@ -316,8 +316,8 @@ select a1,a2,b,max(c) from t2 where b is NULL group by a1,a2;
select a1,a2,b,min(c),max(c) from t2 where b is NULL group by a1,a2; select a1,a2,b,min(c),max(c) from t2 where b is NULL group by a1,a2;
select a1,a2,b,min(c),max(c) from t2 where b is NULL group by a1,a2; select a1,a2,b,min(c),max(c) from t2 where b is NULL group by a1,a2;
-- C) Range predicates for the MIN/MAX attribute # C) Range predicates for the MIN/MAX attribute
-- plans # plans
--replace_column 9 # --replace_column 9 #
explain select a1,a2,b, max(c) from t1 where (c > 'b1') group by a1,a2,b; explain select a1,a2,b, max(c) from t1 where (c > 'b1') group by a1,a2,b;
explain select a1,a2,b,min(c),max(c) from t1 where (c > 'b1') group by a1,a2,b; explain select a1,a2,b,min(c),max(c) from t1 where (c > 'b1') group by a1,a2,b;
@ -367,7 +367,7 @@ explain select a1,a2,b,min(c),max(c) from t2 where (c < 'c5') or (c = 'g412') or
--replace_column 9 # --replace_column 9 #
explain select a1,a2,b,min(c),max(c) from t2 where ((c > 'b111') and (c <= 'g112')) or ((c > 'd000') and (c <= 'i110')) group by a1,a2,b; explain select a1,a2,b,min(c),max(c) from t2 where ((c > 'b111') and (c <= 'g112')) or ((c > 'd000') and (c <= 'i110')) group by a1,a2,b;
-- queries # queries
select a1,a2,b, max(c) from t1 where (c > 'b1') group by a1,a2,b; select a1,a2,b, max(c) from t1 where (c > 'b1') group by a1,a2,b;
select a1,a2,b,min(c),max(c) from t1 where (c > 'b1') group by a1,a2,b; select a1,a2,b,min(c),max(c) from t1 where (c > 'b1') group by a1,a2,b;
select a1,a2,b, max(c) from t1 where (c > 'f123') group by a1,a2,b; select a1,a2,b, max(c) from t1 where (c > 'f123') group by a1,a2,b;
@ -401,19 +401,19 @@ select a1,a2,b,min(c),max(c) from t2 where (c > 'b111') and (c <= 'g112') group
select a1,a2,b,min(c),max(c) from t2 where (c < 'c5') or (c = 'g412') or (c = 'k421') group by a1,a2,b; select a1,a2,b,min(c),max(c) from t2 where (c < 'c5') or (c = 'g412') or (c = 'k421') group by a1,a2,b;
select a1,a2,b,min(c),max(c) from t2 where ((c > 'b111') and (c <= 'g112')) or ((c > 'd000') and (c <= 'i110')) group by a1,a2,b; select a1,a2,b,min(c),max(c) from t2 where ((c > 'b111') and (c <= 'g112')) or ((c > 'd000') and (c <= 'i110')) group by a1,a2,b;
-- analyze the sub-select # analyze the sub-select
explain select a1,a2,b,min(c),max(c) from t1 explain select a1,a2,b,min(c),max(c) from t1
where exists ( select * from t2 where t2.c = t1.c ) where exists ( select * from t2 where t2.c = t1.c )
group by a1,a2,b; group by a1,a2,b;
-- the sub-select is unrelated to MIN/MAX # the sub-select is unrelated to MIN/MAX
explain select a1,a2,b,min(c),max(c) from t1 explain select a1,a2,b,min(c),max(c) from t1
where exists ( select * from t2 where t2.c > 'b1' ) where exists ( select * from t2 where t2.c > 'b1' )
group by a1,a2,b; group by a1,a2,b;
-- A,B,C) Predicates referencing mixed classes of attributes # A,B,C) Predicates referencing mixed classes of attributes
-- plans # plans
explain select a1,a2,b,min(c),max(c) from t1 where (a1 >= 'c' or a2 < 'b') and (b > 'a') group by a1,a2,b; explain select a1,a2,b,min(c),max(c) from t1 where (a1 >= 'c' or a2 < 'b') and (b > 'a') group by a1,a2,b;
explain select a1,a2,b,min(c),max(c) from t1 where (a1 >= 'c' or a2 < 'b') and (c > 'b111') group by a1,a2,b; explain select a1,a2,b,min(c),max(c) from t1 where (a1 >= 'c' or a2 < 'b') and (c > 'b111') group by a1,a2,b;
explain select a1,a2,b,min(c),max(c) from t1 where (a2 >= 'b') and (b = 'a') and (c > 'b111') group by a1,a2,b; explain select a1,a2,b,min(c),max(c) from t1 where (a2 >= 'b') and (b = 'a') and (c > 'b111') group by a1,a2,b;
@ -435,7 +435,7 @@ explain select a1,a2,b,min(c) from t2 where ((a1 > 'a') or (a1 < '9')) and ((a2
--replace_column 9 # --replace_column 9 #
explain select a1,a2,b,min(c) from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b; explain select a1,a2,b,min(c) from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
-- queries # queries
select a1,a2,b,min(c),max(c) from t1 where (a1 >= 'c' or a2 < 'b') and (b > 'a') group by a1,a2,b; select a1,a2,b,min(c),max(c) from t1 where (a1 >= 'c' or a2 < 'b') and (b > 'a') group by a1,a2,b;
select a1,a2,b,min(c),max(c) from t1 where (a1 >= 'c' or a2 < 'b') and (c > 'b111') group by a1,a2,b; select a1,a2,b,min(c),max(c) from t1 where (a1 >= 'c' or a2 < 'b') and (c > 'b111') group by a1,a2,b;
select a1,a2,b,min(c),max(c) from t1 where (a2 >= 'b') and (b = 'a') and (c > 'b111') group by a1,a2,b; select a1,a2,b,min(c),max(c) from t1 where (a2 >= 'b') and (b = 'a') and (c > 'b111') group by a1,a2,b;
@ -452,11 +452,11 @@ select a1,a2,b,min(c) from t2 where ((a1 > 'a') or (a1 < '9')) and ((a2 >= 'b')
select a1,a2,b,min(c) from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b; select a1,a2,b,min(c) from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
-- #
-- GROUP BY queries without MIN/MAX # GROUP BY queries without MIN/MAX
-- #
-- plans # plans
explain select a1,a2,b from t1 where (a1 >= 'c' or a2 < 'b') and (b > 'a') group by a1,a2,b; explain select a1,a2,b from t1 where (a1 >= 'c' or a2 < 'b') and (b > 'a') group by a1,a2,b;
explain select a1,a2,b from t1 where (a2 >= 'b') and (b = 'a') group by a1,a2,b; explain select a1,a2,b from t1 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;
explain select a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121') group by a1,a2,b; explain select a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121') group by a1,a2,b;
@ -471,7 +471,7 @@ explain select a1,a2,b,c from t2 where (a2 >= 'b') and (b = 'a') and (c = 'i121'
--replace_column 9 # --replace_column 9 #
explain select a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b; explain select a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
-- queries # queries
select a1,a2,b from t1 where (a1 >= 'c' or a2 < 'b') and (b > 'a') group by a1,a2,b; select a1,a2,b from t1 where (a1 >= 'c' or a2 < 'b') and (b > 'a') group by a1,a2,b;
select a1,a2,b from t1 where (a2 >= 'b') and (b = 'a') group by a1,a2,b; select a1,a2,b from t1 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;
select a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121') group by a1,a2,b; select a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121') group by a1,a2,b;
@ -482,11 +482,11 @@ select a1,a2,b from t2 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;
select a1,a2,b,c from t2 where (a2 >= 'b') and (b = 'a') and (c = 'i121') group by a1,a2,b; select a1,a2,b,c from t2 where (a2 >= 'b') and (b = 'a') and (c = 'i121') group by a1,a2,b;
select a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b; select a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
-- #
-- DISTINCT queries # DISTINCT queries
-- #
-- plans # plans
explain select distinct a1,a2,b from t1; explain select distinct a1,a2,b from t1;
explain select distinct a1,a2,b from t1 where (a2 >= 'b') and (b = 'a'); explain select distinct a1,a2,b from t1 where (a2 >= 'b') and (b = 'a');
explain extended select distinct a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121'); explain extended select distinct a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121');
@ -502,7 +502,7 @@ explain extended select distinct a1,a2,b,c from t2 where (a2 >= 'b') and (b = 'a
explain select distinct a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c'); explain select distinct a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c');
explain select distinct b from t2 where (a2 >= 'b') and (b = 'a'); explain select distinct b from t2 where (a2 >= 'b') and (b = 'a');
-- queries # queries
select distinct a1,a2,b from t1; select distinct a1,a2,b from t1;
select distinct a1,a2,b from t1 where (a2 >= 'b') and (b = 'a'); select distinct a1,a2,b from t1 where (a2 >= 'b') and (b = 'a');
select distinct a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121'); select distinct a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121');
@ -515,22 +515,22 @@ select distinct a1,a2,b,c from t2 where (a2 >= 'b') and (b = 'a') and (c = 'i121
select distinct a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c'); select distinct a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c');
select distinct b from t2 where (a2 >= 'b') and (b = 'a'); select distinct b from t2 where (a2 >= 'b') and (b = 'a');
-- BUG #6303 # BUG #6303
select distinct t_00.a1 select distinct t_00.a1
from t1 t_00 from t1 t_00
where exists ( select * from t2 where a1 = t_00.a1 ); where exists ( select * from t2 where a1 = t_00.a1 );
-- BUG #8532 - SELECT DISTINCT a, a causes server to crash # BUG #8532 - SELECT DISTINCT a, a causes server to crash
select distinct a1,a1 from t1; select distinct a1,a1 from t1;
select distinct a2,a1,a2,a1 from t1; select distinct a2,a1,a2,a1 from t1;
select distinct t1.a1,t2.a1 from t1,t2; select distinct t1.a1,t2.a1 from t1,t2;
-- #
-- DISTINCT queries with GROUP-BY # DISTINCT queries with GROUP-BY
-- #
-- plans # plans
explain select distinct a1,a2,b from t1; explain select distinct a1,a2,b from t1;
explain select distinct a1,a2,b from t1 where (a2 >= 'b') and (b = 'a') group by a1,a2,b; explain select distinct a1,a2,b from t1 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;
explain select distinct a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121') group by a1,a2,b; explain select distinct a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121') group by a1,a2,b;
@ -548,7 +548,7 @@ explain select distinct a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b =
--replace_column 9 # --replace_column 9 #
explain select distinct b from t2 where (a2 >= 'b') and (b = 'a') group by a1,a2,b; explain select distinct b from t2 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;
-- queries # queries
select distinct a1,a2,b from t1; select distinct a1,a2,b from t1;
select distinct a1,a2,b from t1 where (a2 >= 'b') and (b = 'a') group by a1,a2,b; select distinct a1,a2,b from t1 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;
select distinct a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121') group by a1,a2,b; select distinct a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121') group by a1,a2,b;
@ -562,9 +562,9 @@ select distinct a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c') gr
select distinct b from t2 where (a2 >= 'b') and (b = 'a') group by a1,a2,b; select distinct b from t2 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;
-- #
-- COUNT (DISTINCT cols) queries # COUNT (DISTINCT cols) queries
-- #
explain select count(distinct a1,a2,b) from t1 where (a2 >= 'b') and (b = 'a'); explain select count(distinct a1,a2,b) from t1 where (a2 >= 'b') and (b = 'a');
explain select count(distinct a1,a2,b,c) from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121'); explain select count(distinct a1,a2,b,c) from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121');
@ -578,9 +578,9 @@ select count(distinct a1,a2,b) from t1 where (a1 > 'a') and (a2 > 'a') and (b =
select count(distinct b) from t1 where (a2 >= 'b') and (b = 'a'); select count(distinct b) from t1 where (a2 >= 'b') and (b = 'a');
select ord(a1) + count(distinct a1,a2,b) from t1 where (a1 > 'a') and (a2 > 'a'); select ord(a1) + count(distinct a1,a2,b) from t1 where (a1 > 'a') and (a2 > 'a');
-- #
-- Queries with expressions in the select clause # Queries with expressions in the select clause
-- #
explain select a1,a2,b, concat(min(c), max(c)) from t1 where a1 < 'd' group by a1,a2,b; explain select a1,a2,b, concat(min(c), max(c)) from t1 where a1 < 'd' group by a1,a2,b;
explain select concat(a1,min(c)),b from t1 where a1 < 'd' group by a1,a2,b; explain select concat(a1,min(c)),b from t1 where a1 < 'd' group by a1,a2,b;
@ -595,48 +595,48 @@ select concat(a1,a2),b,min(c),max(c) from t1 where a1 < 'd' group by a1,a2,b;
select concat(ord(min(b)),ord(max(b))),min(b),max(b) from t1 group by a1,a2; select concat(ord(min(b)),ord(max(b))),min(b),max(b) from t1 group by a1,a2;
-- #
-- Negative examples: queries that should NOT be treated as optimizable by # Negative examples: queries that should NOT be treated as optimizable by
-- QUICK_GROUP_MIN_MAX_SELECT # QUICK_GROUP_MIN_MAX_SELECT
-- #
-- select a non-indexed attribute # select a non-indexed attribute
explain select a1,a2,b,d,min(c),max(c) from t1 group by a1,a2,b; explain select a1,a2,b,d,min(c),max(c) from t1 group by a1,a2,b;
explain select a1,a2,b,d from t1 group by a1,a2,b; explain select a1,a2,b,d from t1 group by a1,a2,b;
-- predicate that references an attribute that is after the MIN/MAX argument # predicate that references an attribute that is after the MIN/MAX argument
-- in the index # in the index
explain extended select a1,a2,min(b),max(b) from t1 explain extended select a1,a2,min(b),max(b) from t1
where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (c > 'a111') group by a1,a2; where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (c > 'a111') group by a1,a2;
-- predicate that references a non-indexed attribute # predicate that references a non-indexed attribute
explain extended select a1,a2,b,min(c),max(c) from t1 explain extended select a1,a2,b,min(c),max(c) from t1
where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (d > 'xy2') group by a1,a2,b; where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (d > 'xy2') group by a1,a2,b;
explain extended select a1,a2,b,c from t1 explain extended select a1,a2,b,c from t1
where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (d > 'xy2') group by a1,a2,b,c; where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (d > 'xy2') group by a1,a2,b,c;
-- non-equality predicate for a non-group select attribute # non-equality predicate for a non-group select attribute
explain select a1,a2,b,max(c),min(c) from t2 where (a2 = 'a') and (b = 'b') or (b < 'b') group by a1; explain select a1,a2,b,max(c),min(c) from t2 where (a2 = 'a') and (b = 'b') or (b < 'b') group by a1;
explain extended select a1,a2,b from t1 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (c > 'a111') group by a1,a2,b; explain extended select a1,a2,b from t1 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (c > 'a111') group by a1,a2,b;
-- non-group field with an equality predicate that references a keypart after the # non-group field with an equality predicate that references a keypart after the
-- MIN/MAX argument # MIN/MAX argument
explain select a1,a2,min(b),c from t2 where (a2 = 'a') and (c = 'a111') group by a1; explain select a1,a2,min(b),c from t2 where (a2 = 'a') and (c = 'a111') group by a1;
select a1,a2,min(b),c from t2 where (a2 = 'a') and (c = 'a111') group by a1; select a1,a2,min(b),c from t2 where (a2 = 'a') and (c = 'a111') group by a1;
-- disjunction for a non-group select attribute # disjunction for a non-group select attribute
explain select a1,a2,b,max(c),min(c) from t2 where (a2 = 'a') and (b = 'b') or (b = 'a') group by a1; explain select a1,a2,b,max(c),min(c) from t2 where (a2 = 'a') and (b = 'b') or (b = 'a') group by a1;
-- non-range predicate for the MIN/MAX attribute # non-range predicate for the MIN/MAX attribute
explain select a1,a2,b,min(c),max(c) from t2 explain select a1,a2,b,min(c),max(c) from t2
where (c > 'a000') and (c <= 'd999') and (c like '_8__') group by a1,a2,b; where (c > 'a000') and (c <= 'd999') and (c like '_8__') group by a1,a2,b;
-- not all attributes are indexed by one index # not all attributes are indexed by one index
explain select a1, a2, b, c, min(d), max(d) from t1 group by a1,a2,b,c; explain select a1, a2, b, c, min(d), max(d) from t1 group by a1,a2,b,c;
-- other aggregate functions than MIN/MAX # other aggregate functions than MIN/MAX
explain select a1,a2,count(a2) from t1 group by a1,a2,b; explain select a1,a2,count(a2) from t1 group by a1,a2,b;
explain extended select a1,a2,count(a2) from t1 where (a1 > 'a') group by a1,a2,b; explain extended select a1,a2,count(a2) from t1 where (a1 > 'a') group by a1,a2,b;
explain extended select sum(ord(a1)) from t1 where (a1 > 'a') group by a1,a2,b; explain extended select sum(ord(a1)) from t1 where (a1 > 'a') group by a1,a2,b;
@ -790,24 +790,24 @@ INSERT INTO t4 VALUES(1);
INSERT INTO t5 VALUES(1,1); INSERT INTO t5 VALUES(1,1);
INSERT INTO t6 VALUES(1); INSERT INTO t6 VALUES(1);
-- original bug query # original bug query
SELECT * FROM SELECT * FROM
t1 t1
NATURAL JOIN NATURAL JOIN
(t2 JOIN (t3 NATURAL JOIN t4, t5 NATURAL JOIN t6) (t2 JOIN (t3 NATURAL JOIN t4, t5 NATURAL JOIN t6)
ON (t3.id3 = t2.id3 AND t5.id5 = t2.id5)); ON (t3.id3 = t2.id3 AND t5.id5 = t2.id5));
-- inner join swapped # inner join swapped
SELECT * FROM SELECT * FROM
t1 t1
NATURAL JOIN NATURAL JOIN
(((t3 NATURAL JOIN t4) join (t5 NATURAL JOIN t6) on t3.id4 = t5.id5) JOIN t2 (((t3 NATURAL JOIN t4) join (t5 NATURAL JOIN t6) on t3.id4 = t5.id5) JOIN t2
ON (t3.id3 = t2.id3 AND t5.id5 = t2.id5)); ON (t3.id3 = t2.id3 AND t5.id5 = t2.id5));
-- one join less, no ON cond # one join less, no ON cond
SELECT * FROM t1 NATURAL JOIN ((t3 join (t5 NATURAL JOIN t6)) JOIN t2); SELECT * FROM t1 NATURAL JOIN ((t3 join (t5 NATURAL JOIN t6)) JOIN t2);
-- wrong error message: 'id2' - ambiguous column # wrong error message: 'id2' - ambiguous column
SELECT * FROM SELECT * FROM
(t2 JOIN (t3 NATURAL JOIN t4, t5 NATURAL JOIN t6) (t2 JOIN (t3 NATURAL JOIN t4, t5 NATURAL JOIN t6)
ON (t3.id3 = t2.id3 AND t5.id5 = t2.id5)) ON (t3.id3 = t2.id3 AND t5.id5 = t2.id5))

View File

@ -1475,7 +1475,7 @@ INSERT INTO t1 (id) VALUES (NULL);
SELECT * FROM t1; SELECT * FROM t1;
DROP TABLE t2, t1; DROP TABLE t2, t1;
-- Test that foreign keys in temporary tables are not accepted (bug #12084) # Test that foreign keys in temporary tables are not accepted (bug #12084)
CREATE TABLE t1 CREATE TABLE t1
( (
id INT PRIMARY KEY id INT PRIMARY KEY

View File

@ -362,38 +362,38 @@ insert into t4 values (2, 3);
insert into t5 values (11,4); insert into t5 values (11,4);
insert into t6 values (2, 3); insert into t6 values (2, 3);
-- Views with simple natural join. # Views with simple natural join.
create algorithm=merge view v1a as create algorithm=merge view v1a as
select * from t1 natural join t2; select * from t1 natural join t2;
-- as above, but column names are cross-renamed: a->c, c->b, b->a # as above, but column names are cross-renamed: a->c, c->b, b->a
create algorithm=merge view v1b(a,b,c) as create algorithm=merge view v1b(a,b,c) as
select * from t1 natural join t2; select * from t1 natural join t2;
-- as above, but column names are aliased: a->c, c->b, b->a # as above, but column names are aliased: a->c, c->b, b->a
create algorithm=merge view v1c as create algorithm=merge view v1c as
select b as a, c as b, a as c from t1 natural join t2; select b as a, c as b, a as c from t1 natural join t2;
-- as above, but column names are cross-renamed, and aliased # as above, but column names are cross-renamed, and aliased
-- a->c->b, c->b->a, b->a->c # a->c->b, c->b->a, b->a->c
create algorithm=merge view v1d(b, a, c) as create algorithm=merge view v1d(b, a, c) as
select a as c, c as b, b as a from t1 natural join t2; select a as c, c as b, b as a from t1 natural join t2;
-- Views with JOIN ... ON # Views with JOIN ... ON
create algorithm=merge view v2a as create algorithm=merge view v2a as
select t1.c, t1.b, t2.a from t1 join (t2 join t4 on b + 1 = y) on t1.c = t4.c; select t1.c, t1.b, t2.a from t1 join (t2 join t4 on b + 1 = y) on t1.c = t4.c;
create algorithm=merge view v2b as create algorithm=merge view v2b as
select t1.c as b, t1.b as a, t2.a as c select t1.c as b, t1.b as a, t2.a as c
from t1 join (t2 join t4 on b + 1 = y) on t1.c = t4.c; from t1 join (t2 join t4 on b + 1 = y) on t1.c = t4.c;
-- Views with bigger natural join # Views with bigger natural join
create algorithm=merge view v3a as create algorithm=merge view v3a as
select * from t1 natural join t2 natural join t3; select * from t1 natural join t2 natural join t3;
create algorithm=merge view v3b as create algorithm=merge view v3b as
select * from t1 natural join (t2 natural join t3); select * from t1 natural join (t2 natural join t3);
-- View over views with mixed natural join and join ... on # View over views with mixed natural join and join ... on
create algorithm=merge view v4 as create algorithm=merge view v4 as
select * from v2a natural join v3a; select * from v2a natural join v3a;
-- Nested natural/using joins. # Nested natural/using joins.
select * from (t1 natural join t2) natural join (t3 natural join t4); select * from (t1 natural join t2) natural join (t3 natural join t4);
select * from (t1 natural join t2) natural left join (t3 natural join t4); select * from (t1 natural join t2) natural left join (t3 natural join t4);
select * from (t3 natural join t4) natural right join (t1 natural join t2); select * from (t3 natural join t4) natural right join (t1 natural join t2);
@ -402,12 +402,12 @@ select * from (t4 natural right join t3) natural right join (t2 natural right jo
select * from t1 natural join t2 natural join t3 natural join t4; select * from t1 natural join t2 natural join t3 natural join t4;
select * from ((t1 natural join t2) natural join t3) natural join t4; select * from ((t1 natural join t2) natural join t3) natural join t4;
select * from t1 natural join (t2 natural join (t3 natural join t4)); select * from t1 natural join (t2 natural join (t3 natural join t4));
-- BUG#15355: this query fails in 'prepared statements' mode # BUG#15355: this query fails in 'prepared statements' mode
-- select * from ((t3 natural join (t1 natural join t2)) natural join t4) natural join t5; # select * from ((t3 natural join (t1 natural join t2)) natural join t4) natural join t5;
-- select * from ((t3 natural left join (t1 natural left join t2)) natural left join t4) natural left join t5; # select * from ((t3 natural left join (t1 natural left join t2)) natural left join t4) natural left join t5;
select * from t5 natural right join (t4 natural right join ((t2 natural right join t1) natural right join t3)); select * from t5 natural right join (t4 natural right join ((t2 natural right join t1) natural right join t3));
select * from (t1 natural join t2), (t3 natural join t4); select * from (t1 natural join t2), (t3 natural join t4);
-- MySQL extension - nested comma ',' operator instead of cross join. # MySQL extension - nested comma ',' operator instead of cross join.
select * from t5 natural join ((t1 natural join t2), (t3 natural join t4)); select * from t5 natural join ((t1 natural join t2), (t3 natural join t4));
select * from ((t1 natural join t2), (t3 natural join t4)) natural join t5; select * from ((t1 natural join t2), (t3 natural join t4)) natural join t5;
select * from t5 natural join ((t1 natural join t2) cross join (t3 natural join t4)); select * from t5 natural join ((t1 natural join t2) cross join (t3 natural join t4));
@ -417,7 +417,7 @@ select * from (t1 join t2 using (b)) join (t3 join t4 using (c)) using (c);
select * from (t1 join t2 using (b)) natural join (t3 join t4 using (c)); select * from (t1 join t2 using (b)) natural join (t3 join t4 using (c));
-- Other clauses refer to NJ columns. # Other clauses refer to NJ columns.
select a,b,c from (t1 natural join t2) natural join (t3 natural join t4) select a,b,c from (t1 natural join t2) natural join (t3 natural join t4)
where b + 1 = y or b + 10 = y group by b,c,a having min(b) < max(y) order by a; where b + 1 = y or b + 10 = y group by b,c,a having min(b) < max(y) order by a;
select * from (t1 natural join t2) natural left join (t3 natural join t4) select * from (t1 natural join t2) natural left join (t3 natural join t4)
@ -425,23 +425,23 @@ where b + 1 = y or b + 10 = y group by b,c,a,y having min(b) < max(y) order by a
select * from (t3 natural join t4) natural right join (t1 natural join t2) select * from (t3 natural join t4) natural right join (t1 natural join t2)
where b + 1 = y or b + 10 = y group by b,c,a,y having min(b) < max(y) order by a, y; where b + 1 = y or b + 10 = y group by b,c,a,y having min(b) < max(y) order by a, y;
-- Qualified column references to NJ columns. # Qualified column references to NJ columns.
select * from t1 natural join t2 where t1.c > t2.a; select * from t1 natural join t2 where t1.c > t2.a;
select * from t1 natural join t2 where t1.b > t2.b; select * from t1 natural join t2 where t1.b > t2.b;
select * from t1 natural left join (t4 natural join t5) where t5.z is not NULL; select * from t1 natural left join (t4 natural join t5) where t5.z is not NULL;
-- Nested 'join ... on' - name resolution of ON conditions # Nested 'join ... on' - name resolution of ON conditions
select * from t1 join (t2 join t4 on b + 1 = y) on t1.c = t4.c; select * from t1 join (t2 join t4 on b + 1 = y) on t1.c = t4.c;
select * from (t2 join t4 on b + 1 = y) join t1 on t1.c = t4.c; select * from (t2 join t4 on b + 1 = y) join t1 on t1.c = t4.c;
select * from t1 natural join (t2 join t4 on b + 1 = y); select * from t1 natural join (t2 join t4 on b + 1 = y);
select * from (t1 cross join t2) join (t3 cross join t4) on (a < y and t2.b < t3.c); select * from (t1 cross join t2) join (t3 cross join t4) on (a < y and t2.b < t3.c);
-- MySQL extension - 'join ... on' over nested comma operator # MySQL extension - 'join ... on' over nested comma operator
select * from (t1, t2) join (t3, t4) on (a < y and t2.b < t3.c); select * from (t1, t2) join (t3, t4) on (a < y and t2.b < t3.c);
select * from (t1 natural join t2) join (t3 natural join t4) on a = y; select * from (t1 natural join t2) join (t3 natural join t4) on a = y;
select * from ((t3 join (t1 join t2 on c > a) on t3.b < t2.a) join t4 on y > t1.c) join t5 on z = t1.b + 3; select * from ((t3 join (t1 join t2 on c > a) on t3.b < t2.a) join t4 on y > t1.c) join t5 on z = t1.b + 3;
-- MySQL extension - refererence qualified coalesced columns # MySQL extension - refererence qualified coalesced columns
select * from t1 natural join t2 where t1.b > 0; select * from t1 natural join t2 where t1.b > 0;
select * from t1 natural join (t4 natural join t5) where t4.y > 7; select * from t1 natural join (t4 natural join t5) where t4.y > 7;
select * from (t4 natural join t5) natural join t1 where t4.y > 7; select * from (t4 natural join t5) natural join t1 where t4.y > 7;
@ -449,11 +449,11 @@ select * from t1 natural left join (t4 natural join t5) where t4.y > 7;
select * from (t4 natural join t5) natural right join t1 where t4.y > 7; select * from (t4 natural join t5) natural right join t1 where t4.y > 7;
select * from (t1 natural join t2) join (t3 natural join t4) on t1.b = t3.b; select * from (t1 natural join t2) join (t3 natural join t4) on t1.b = t3.b;
-- MySQL extension - select qualified columns of NJ columns # MySQL extension - select qualified columns of NJ columns
select t1.*, t2.* from t1 natural join t2; select t1.*, t2.* from t1 natural join t2;
select t1.*, t2.*, t3.*, t4.* from (t1 natural join t2) natural join (t3 natural join t4); select t1.*, t2.*, t3.*, t4.* from (t1 natural join t2) natural join (t3 natural join t4);
-- Queries over subselects in the FROM clause # Queries over subselects in the FROM clause
select * from (select * from t1 natural join t2) as t12 select * from (select * from t1 natural join t2) as t12
natural join natural join
(select * from t3 natural join t4) as t34; (select * from t3 natural join t4) as t34;
@ -464,7 +464,7 @@ select * from (select * from t3 natural join t4) as t34
natural right join natural right join
(select * from t1 natural join t2) as t12; (select * from t1 natural join t2) as t12;
-- Queries over views # Queries over views
select * from v1a; select * from v1a;
select * from v1b; select * from v1b;
select * from v1c; select * from v1c;
@ -481,13 +481,13 @@ select * from v1c join v2a on v1c.b = v2a.c;
select * from v1d join v2a on v1d.a = v2a.c; select * from v1d join v2a on v1d.a = v2a.c;
select * from v1a join (t3 natural join t4) on a = y; select * from v1a join (t3 natural join t4) on a = y;
-- TODO: add tests with correlated subqueries for natural join/join on. # TODO: add tests with correlated subqueries for natural join/join on.
-- related to BUG#15269 # related to BUG#15269
---------------------------------------------------------------------- #--------------------------------------------------------------------
-- Negative tests (tests for errors) # Negative tests (tests for errors)
---------------------------------------------------------------------- #--------------------------------------------------------------------
-- error 1052 -- error 1052
select * from t1 natural join (t3 cross join t4); -- works in Oracle - bug select * from t1 natural join (t3 cross join t4); -- works in Oracle - bug
-- error 1052 -- error 1052
@ -504,7 +504,7 @@ select * from t6 natural join ((t1 natural join t2), (t3 natural join t4));
select * from (t1 join t2 on t1.b=t2.b) natural join (t3 natural join t4); select * from (t1 join t2 on t1.b=t2.b) natural join (t3 natural join t4);
-- error 1052 -- error 1052
select * from (t3 natural join t4) natural join (t1 join t2 on t1.b=t2.b); select * from (t3 natural join t4) natural join (t1 join t2 on t1.b=t2.b);
-- this one is OK, the next equivalent one is incorrect (bug in Oracle) # this one is OK, the next equivalent one is incorrect (bug in Oracle)
-- error 1052 -- error 1052
select * from (t3 join (t4 natural join t5) on (b < z)) select * from (t3 join (t4 natural join t5) on (b < z))
natural join natural join
@ -579,12 +579,12 @@ insert into t3 values (2,3);
insert into t4 values (1,3); insert into t4 values (1,3);
insert into t5 values (1,4); insert into t5 values (1,4);
-- this fails # this fails
prepare stmt1 from "select * from ((t3 natural join (t1 natural join t2)) prepare stmt1 from "select * from ((t3 natural join (t1 natural join t2))
natural join t4) natural join t5"; natural join t4) natural join t5";
execute stmt1; execute stmt1;
-- this works # this works
select * from ((t3 natural join (t1 natural join t2)) natural join t4) select * from ((t3 natural join (t1 natural join t2)) natural join t4)
natural join t5; natural join t5;
drop table t1, t2, t3, t4, t5; drop table t1, t2, t3, t4, t5;

View File

@ -7,7 +7,7 @@ drop table if exists t1;
--enable_warnings --enable_warnings
create table t1 (a int not null default 0 primary key, b int not null default 0); create table t1 (a int not null default 0 primary key, b int not null default 0);
insert into t1 () values (); -- Testing default values insert into t1 () values (); # Testing default values
insert into t1 values (1,1),(2,1),(3,1); insert into t1 values (1,1),(2,1),(3,1);
update t1 set a=4 where b=1 limit 1; update t1 set a=4 where b=1 limit 1;
select * from t1; select * from t1;

View File

@ -177,7 +177,7 @@ drop table t1;
# non-null string collation, i.e. case insensitively, # non-null string collation, i.e. case insensitively,
# rather than according to NULL's collation, i.e. case sensitively # rather than according to NULL's collation, i.e. case sensitively
# #
-- in field # in field
select select
case 'str' when 'STR' then 'str' when null then 'null' end as c01, case 'str' when 'STR' then 'str' when null then 'null' end as c01,
case 'str' when null then 'null' when 'STR' then 'str' end as c02, case 'str' when null then 'null' when 'STR' then 'str' end as c02,

View File

@ -2701,7 +2701,7 @@ insert into t2 values ('58013'),('58014'),('58015'),('58016');
create table t3 (a_id int(11) not null, b_id char(16) character set utf8); create table t3 (a_id int(11) not null, b_id char(16) character set utf8);
insert into t3 values (123,null),(123,null),(123,null),(123,null),(123,null),(123,'58013'); insert into t3 values (123,null),(123,null),(123,null),(123,null),(123,null),(123,'58013');
-- both queries are equivalent # both queries are equivalent
select count(*) select count(*)
from t1 inner join (t3 left join t2 on t2.id = t3.b_id) on t1.id = t3.a_id; from t1 inner join (t3 left join t2 on t2.id = t3.b_id) on t1.id = t3.a_id;
@ -2941,7 +2941,7 @@ create table t2 (
insert into t1 (b,c) values (0,1), (0,1); insert into t1 (b,c) values (0,1), (0,1);
insert into t2 (b,c) values (0,1); insert into t2 (b,c) values (0,1);
-- Row 1 should succeed. Row 2 should fail. Both fail. # Row 1 should succeed. Row 2 should fail. Both fail.
select t1.a, t1.b + 0, t1.c + 0, t2.a, t2.b + 0, t2.c, t2.d select t1.a, t1.b + 0, t1.c + 0, t2.a, t2.b + 0, t2.c, t2.d
from t1 left outer join t2 on t1.a = t2.c and t2.b <> 1 from t1 left outer join t2 on t1.a = t2.c and t2.b <> 1
where t1.b <> 1 order by t1.a; where t1.b <> 1 order by t1.a;

View File

@ -209,7 +209,7 @@ select f3() //
call sp1() // call sp1() //
--------------- # ---------------
drop procedure sp1// drop procedure sp1//
drop function f3// drop function f3//

View File

@ -327,14 +327,14 @@ INSERT INTO t1 (col2) VALUES(CAST('0000-00-00' AS DATETIME));
# SQLSTATE 22007 <invalid datetime value> # SQLSTATE 22007 <invalid datetime value>
--error 1292 --error 1292
INSERT INTO t1 (col3) VALUES(CAST('0000-10-31 15:30' AS DATETIME)); INSERT INTO t1 (col3) VALUES(CAST('0000-10-31 15:30' AS DATETIME));
-- should return OK # should return OK
-- We accept this to be a failure # We accept this to be a failure
--error 1292 --error 1292
INSERT INTO t1 (col3) VALUES(CAST('2004-10-0 15:30' AS DATETIME)); INSERT INTO t1 (col3) VALUES(CAST('2004-10-0 15:30' AS DATETIME));
--error 1292 --error 1292
INSERT INTO t1 (col3) VALUES(CAST('2004-0-10 15:30' AS DATETIME)); INSERT INTO t1 (col3) VALUES(CAST('2004-0-10 15:30' AS DATETIME));
-- should return SQLSTATE 22007 <invalid datetime value> # should return SQLSTATE 22007 <invalid datetime value>
# deactivated because of Bug#8294 # deactivated because of Bug#8294
# Bug#8294 Traditional: Misleading error message for invalid CAST to DATE # Bug#8294 Traditional: Misleading error message for invalid CAST to DATE
@ -422,8 +422,8 @@ INSERT INTO t1 (col2) VALUES(CONVERT('0000-00-00',DATETIME));
# SQLSTATE 22007 <invalid datetime value> # SQLSTATE 22007 <invalid datetime value>
--error 1292 --error 1292
INSERT INTO t1 (col3) VALUES(CONVERT('0000-10-31 15:30',DATETIME)); INSERT INTO t1 (col3) VALUES(CONVERT('0000-10-31 15:30',DATETIME));
-- should return OK # should return OK
-- We accept this to be a failure # We accept this to be a failure
--error 1292 --error 1292
INSERT INTO t1 (col3) VALUES(CONVERT('2004-10-0 15:30',DATETIME)); INSERT INTO t1 (col3) VALUES(CONVERT('2004-10-0 15:30',DATETIME));
@ -729,11 +729,11 @@ DROP TABLE t1;
CREATE TABLE t1 (col1 NUMERIC(4,2)); CREATE TABLE t1 (col1 NUMERIC(4,2));
INSERT INTO t1 VALUES (10.55),(10.5555),(0),(-10.55),(-10.5555),(11),(1e+01); INSERT INTO t1 VALUES (10.55),(10.5555),(0),(-10.55),(-10.5555),(11),(1e+01);
-- Note that the +/-10.5555 is inserted as +/-10.55, not +/-10.56 ! # Note that the +/-10.5555 is inserted as +/-10.55, not +/-10.56 !
INSERT INTO t1 VALUES ('10.55'),('10.5555'),('-10.55'),('-10.5555'),('11'),('1e+01'); INSERT INTO t1 VALUES ('10.55'),('10.5555'),('-10.55'),('-10.5555'),('11'),('1e+01');
-- The 2 following inserts should generate a warning, but doesn't yet # The 2 following inserts should generate a warning, but doesn't yet
-- because NUMERIC works like DECIMAL # because NUMERIC works like DECIMAL
--error 1264 --error 1264
INSERT INTO t1 VALUES (101.55); INSERT INTO t1 VALUES (101.55);
--error 1264 --error 1264
@ -744,8 +744,8 @@ INSERT INTO t1 VALUES (-101.55);
INSERT INTO t1 VALUES (1010.55); INSERT INTO t1 VALUES (1010.55);
--error 1264 --error 1264
INSERT INTO t1 VALUES (1010); INSERT INTO t1 VALUES (1010);
-- The 2 following inserts should generate a warning, but doesn't yet # The 2 following inserts should generate a warning, but doesn't yet
-- because NUMERIC works like DECIMAL # because NUMERIC works like DECIMAL
--error 1264 --error 1264
INSERT INTO t1 VALUES ('101.55'); INSERT INTO t1 VALUES ('101.55');
--error 1264 --error 1264

View File

@ -108,7 +108,7 @@ select * from t3 where a in (select a,b from t2);
-- error 1241 -- error 1241
select * from t3 where a in (select * from t2); select * from t3 where a in (select * from t2);
insert into t4 values (12,7),(1,7),(10,9),(9,6),(7,6),(3,9),(1,10); insert into t4 values (12,7),(1,7),(10,9),(9,6),(7,6),(3,9),(1,10);
-- empty set # empty set
select b,max(a) as ma from t4 group by b having b < (select max(t2.a) from t2 where t2.b=t4.b); select b,max(a) as ma from t4 group by b having b < (select max(t2.a) from t2 where t2.b=t4.b);
insert into t2 values (2,10); insert into t2 values (2,10);
select b,max(a) as ma from t4 group by b having ma < (select max(t2.a) from t2 where t2.b=t4.b); select b,max(a) as ma from t4 group by b having ma < (select max(t2.a) from t2 where t2.b=t4.b);
@ -2247,11 +2247,11 @@ drop table t1;
# Bug#19700: subselect returning BIGINT always returned it as SIGNED # Bug#19700: subselect returning BIGINT always returned it as SIGNED
# #
CREATE TABLE t1 (i BIGINT UNSIGNED); CREATE TABLE t1 (i BIGINT UNSIGNED);
INSERT INTO t1 VALUES (10000000000000000000); -- > MAX SIGNED BIGINT 9323372036854775807 INSERT INTO t1 VALUES (10000000000000000000); # > MAX SIGNED BIGINT 9323372036854775807
INSERT INTO t1 VALUES (1); INSERT INTO t1 VALUES (1);
CREATE TABLE t2 (i BIGINT UNSIGNED); CREATE TABLE t2 (i BIGINT UNSIGNED);
INSERT INTO t2 VALUES (10000000000000000000); -- same as first table INSERT INTO t2 VALUES (10000000000000000000); # same as first table
INSERT INTO t2 VALUES (1); INSERT INTO t2 VALUES (1);
/* simple test */ /* simple test */

View File

@ -613,7 +613,7 @@ select truncate(99.999999999999999999999999999999999999,31);
#-- should return 99.9999999999999999999999999999999 #-- should return 99.9999999999999999999999999999999
# #
select truncate(99999999999999999999999999999999999999,-31); select truncate(99999999999999999999999999999999999999,-31);
-- should return 90000000000000000000000000000000 # should return 90000000000000000000000000000000
# #
#-- 6. Set functions (AVG, SUM, COUNT) should work. #-- 6. Set functions (AVG, SUM, COUNT) should work.
# #
@ -810,7 +810,7 @@ select 1 / 0;
#BUG#6048 Stored procedure causes operating system reboot #BUG#6048 Stored procedure causes operating system reboot
#BUG#6053 DOUBLE PRECISION literal #BUG#6053 DOUBLE PRECISION literal
-- Tests from 'traditional' mode tests # Tests from 'traditional' mode tests
# #
set sql_mode='ansi,traditional'; set sql_mode='ansi,traditional';
# #

View File

@ -806,7 +806,7 @@ DROP DATABASE mysqltest1;
CREATE TABLE t1 (a INT PRIMARY KEY); CREATE TABLE t1 (a INT PRIMARY KEY);
INSERT INTO t1 VALUES (1), (2), (3); INSERT INTO t1 VALUES (1), (2), (3);
CREATE DEFINER = 'no-such-user'@localhost VIEW v AS SELECT a from t1; CREATE DEFINER = 'no-such-user'@localhost VIEW v AS SELECT a from t1;
--warning 1448 #--warning 1448
SHOW CREATE VIEW v; SHOW CREATE VIEW v;
--error 1449 --error 1449
SELECT * FROM v; SELECT * FROM v;

View File

@ -488,7 +488,7 @@ static int search_default_file(Process_option_func opt_handler,
my_bool have_ext= fn_ext(config_file)[0] != 0; my_bool have_ext= fn_ext(config_file)[0] != 0;
const char **exts_to_use= have_ext ? empty_list : f_extensions; const char **exts_to_use= have_ext ? empty_list : f_extensions;
for (ext= (char**) exts_to_use; *ext; *ext++) for (ext= (char**) exts_to_use; *ext; ext++)
{ {
int error; int error;
if ((error= search_default_file_with_ext(opt_handler, handler_ctx, if ((error= search_default_file_with_ext(opt_handler, handler_ctx,
@ -676,7 +676,7 @@ static int search_default_file_with_ext(Process_option_func opt_handler,
ext= fn_ext(search_file->name); ext= fn_ext(search_file->name);
/* check extension */ /* check extension */
for (tmp_ext= (char**) f_extensions; *tmp_ext; *tmp_ext++) for (tmp_ext= (char**) f_extensions; *tmp_ext; tmp_ext++)
{ {
if (!strcmp(ext, *tmp_ext)) if (!strcmp(ext, *tmp_ext))
break; break;
@ -869,7 +869,7 @@ void my_print_default_files(const char *conf_file)
{ {
for (dirs=default_directories ; *dirs; dirs++) for (dirs=default_directories ; *dirs; dirs++)
{ {
for (ext= (char**) exts_to_use; *ext; *ext++) for (ext= (char**) exts_to_use; *ext; ext++)
{ {
const char *pos; const char *pos;
char *end; char *end;

View File

@ -53,7 +53,7 @@ _hash_init(HASH *hash,CHARSET_INFO *charset,
void (*free_element)(void*),uint flags CALLER_INFO_PROTO) void (*free_element)(void*),uint flags CALLER_INFO_PROTO)
{ {
DBUG_ENTER("hash_init"); DBUG_ENTER("hash_init");
DBUG_PRINT("enter",("hash: 0x%lx size: %d",hash,size)); DBUG_PRINT("enter",("hash: 0x%lx size: %d", (long) hash, size));
hash->records=0; hash->records=0;
if (my_init_dynamic_array_ci(&hash->array,sizeof(HASH_LINK),size,0)) if (my_init_dynamic_array_ci(&hash->array,sizeof(HASH_LINK),size,0))
@ -109,7 +109,7 @@ static inline void hash_free_elements(HASH *hash)
void hash_free(HASH *hash) void hash_free(HASH *hash)
{ {
DBUG_ENTER("hash_free"); DBUG_ENTER("hash_free");
DBUG_PRINT("enter",("hash: 0x%lx", hash)); DBUG_PRINT("enter",("hash: 0x%lx", (long) hash));
hash_free_elements(hash); hash_free_elements(hash);
hash->free= 0; hash->free= 0;
@ -129,7 +129,7 @@ void hash_free(HASH *hash)
void my_hash_reset(HASH *hash) void my_hash_reset(HASH *hash)
{ {
DBUG_ENTER("my_hash_reset"); DBUG_ENTER("my_hash_reset");
DBUG_PRINT("enter",("hash: 0x%lxd",hash)); DBUG_PRINT("enter",("hash: 0x%lxd", (long) hash));
hash_free_elements(hash); hash_free_elements(hash);
reset_dynamic(&hash->array); reset_dynamic(&hash->array);
@ -644,7 +644,8 @@ my_bool hash_check(HASH *hash)
if ((rec_link=hash_rec_mask(hash,hash_info,blength,records)) != i) if ((rec_link=hash_rec_mask(hash,hash_info,blength,records)) != i)
{ {
DBUG_PRINT("error", DBUG_PRINT("error",
("Record in wrong link at %d: Start %d Record: 0x%lx Record-link %d", idx,i,hash_info->data,rec_link)); ("Record in wrong link at %d: Start %d Record: 0x%lx Record-link %d",
idx, i, (long) hash_info->data, rec_link));
error=1; error=1;
} }
else else
@ -655,12 +656,12 @@ my_bool hash_check(HASH *hash)
} }
if (found != records) if (found != records)
{ {
DBUG_PRINT("error",("Found %ld of %ld records")); DBUG_PRINT("error",("Found %u of %u records", found, records));
error=1; error=1;
} }
if (records) if (records)
DBUG_PRINT("info", DBUG_PRINT("info",
("records: %ld seeks: %d max links: %d hitrate: %.2f", ("records: %u seeks: %d max links: %d hitrate: %.2f",
records,seek,max_links,(float) seek / (float) records)); records,seek,max_links,(float) seek / (float) records));
return error; return error;
} }

View File

@ -28,7 +28,7 @@
LIST *list_add(LIST *root, LIST *element) LIST *list_add(LIST *root, LIST *element)
{ {
DBUG_ENTER("list_add"); DBUG_ENTER("list_add");
DBUG_PRINT("enter",("root: 0x%lx element: 0x%lx", root, element)); DBUG_PRINT("enter",("root: 0x%lx element: 0x%lx", (long) root, (long) element));
if (root) if (root)
{ {
if (root->prev) /* If add in mid of list */ if (root->prev) /* If add in mid of list */

View File

@ -594,7 +594,8 @@ void init_io_cache_share(IO_CACHE *read_cache, IO_CACHE_SHARE *cshare,
DBUG_ENTER("init_io_cache_share"); DBUG_ENTER("init_io_cache_share");
DBUG_PRINT("io_cache_share", ("read_cache: 0x%lx share: 0x%lx " DBUG_PRINT("io_cache_share", ("read_cache: 0x%lx share: 0x%lx "
"write_cache: 0x%lx threads: %u", "write_cache: 0x%lx threads: %u",
read_cache, cshare, write_cache, num_threads)); (long) read_cache, (long) cshare,
(long) write_cache, num_threads));
DBUG_ASSERT(num_threads > 1); DBUG_ASSERT(num_threads > 1);
DBUG_ASSERT(read_cache->type == READ_CACHE); DBUG_ASSERT(read_cache->type == READ_CACHE);
@ -656,7 +657,7 @@ void remove_io_thread(IO_CACHE *cache)
pthread_mutex_lock(&cshare->mutex); pthread_mutex_lock(&cshare->mutex);
DBUG_PRINT("io_cache_share", ("%s: 0x%lx", DBUG_PRINT("io_cache_share", ("%s: 0x%lx",
(cache == cshare->source_cache) ? (cache == cshare->source_cache) ?
"writer" : "reader", cache)); "writer" : "reader", (long) cache));
/* Remove from share. */ /* Remove from share. */
total= --cshare->total_threads; total= --cshare->total_threads;
@ -732,7 +733,7 @@ static int lock_io_cache(IO_CACHE *cache, my_off_t pos)
cshare->running_threads--; cshare->running_threads--;
DBUG_PRINT("io_cache_share", ("%s: 0x%lx pos: %lu running: %u", DBUG_PRINT("io_cache_share", ("%s: 0x%lx pos: %lu running: %u",
(cache == cshare->source_cache) ? (cache == cshare->source_cache) ?
"writer" : "reader", cache, (ulong) pos, "writer" : "reader", (long) cache, (ulong) pos,
cshare->running_threads)); cshare->running_threads));
if (cshare->source_cache) if (cshare->source_cache)
@ -871,7 +872,7 @@ static void unlock_io_cache(IO_CACHE *cache)
DBUG_PRINT("io_cache_share", ("%s: 0x%lx pos: %lu running: %u", DBUG_PRINT("io_cache_share", ("%s: 0x%lx pos: %lu running: %u",
(cache == cshare->source_cache) ? (cache == cshare->source_cache) ?
"writer" : "reader", "writer" : "reader",
cache, (ulong) cshare->pos_in_file, (long) cache, (ulong) cshare->pos_in_file,
cshare->total_threads)); cshare->total_threads));
cshare->running_threads= cshare->total_threads; cshare->running_threads= cshare->total_threads;

View File

@ -404,9 +404,9 @@ int init_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
DBUG_PRINT("exit", DBUG_PRINT("exit",
("disk_blocks: %d block_root: 0x%lx hash_entries: %d\ ("disk_blocks: %d block_root: 0x%lx hash_entries: %d\
hash_root: 0x%lx hash_links: %d hash_link_root: 0x%lx", hash_root: 0x%lx hash_links: %d hash_link_root: 0x%lx",
keycache->disk_blocks, keycache->block_root, keycache->disk_blocks, (long) keycache->block_root,
keycache->hash_entries, keycache->hash_root, keycache->hash_entries, (long) keycache->hash_root,
keycache->hash_links, keycache->hash_link_root)); keycache->hash_links, (long) keycache->hash_link_root));
bzero((gptr) keycache->changed_blocks, bzero((gptr) keycache->changed_blocks,
sizeof(keycache->changed_blocks[0]) * CHANGED_BLOCKS_HASH); sizeof(keycache->changed_blocks[0]) * CHANGED_BLOCKS_HASH);
bzero((gptr) keycache->file_blocks, bzero((gptr) keycache->file_blocks,
@ -621,7 +621,7 @@ void change_key_cache_param(KEY_CACHE *keycache, uint division_limit,
void end_key_cache(KEY_CACHE *keycache, my_bool cleanup) void end_key_cache(KEY_CACHE *keycache, my_bool cleanup)
{ {
DBUG_ENTER("end_key_cache"); DBUG_ENTER("end_key_cache");
DBUG_PRINT("enter", ("key_cache: 0x%lx", keycache)); DBUG_PRINT("enter", ("key_cache: 0x%lx", (long) keycache));
if (!keycache->key_cache_inited) if (!keycache->key_cache_inited)
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
@ -640,7 +640,7 @@ void end_key_cache(KEY_CACHE *keycache, my_bool cleanup)
keycache->blocks_changed= 0; keycache->blocks_changed= 0;
} }
DBUG_PRINT("status", ("used: %d changed: %d w_requests: %lu " DBUG_PRINT("status", ("used: %lu changed: %lu w_requests: %lu "
"writes: %lu r_requests: %lu reads: %lu", "writes: %lu r_requests: %lu reads: %lu",
keycache->blocks_used, keycache->global_blocks_changed, keycache->blocks_used, keycache->global_blocks_changed,
(ulong) keycache->global_cache_w_requests, (ulong) keycache->global_cache_w_requests,
@ -1073,7 +1073,7 @@ static void unreg_request(KEY_CACHE *keycache,
if (block->temperature == BLOCK_WARM) if (block->temperature == BLOCK_WARM)
keycache->warm_blocks--; keycache->warm_blocks--;
block->temperature= BLOCK_HOT; block->temperature= BLOCK_HOT;
KEYCACHE_DBUG_PRINT("unreg_request", ("#warm_blocks=%u", KEYCACHE_DBUG_PRINT("unreg_request", ("#warm_blocks: %lu",
keycache->warm_blocks)); keycache->warm_blocks));
} }
link_block(keycache, block, hot, (my_bool)at_end); link_block(keycache, block, hot, (my_bool)at_end);
@ -1092,7 +1092,7 @@ static void unreg_request(KEY_CACHE *keycache,
keycache->warm_blocks++; keycache->warm_blocks++;
block->temperature= BLOCK_WARM; block->temperature= BLOCK_WARM;
} }
KEYCACHE_DBUG_PRINT("unreg_request", ("#warm_blocks=%u", KEYCACHE_DBUG_PRINT("unreg_request", ("#warm_blocks: %lu",
keycache->warm_blocks)); keycache->warm_blocks));
} }
} }
@ -1345,11 +1345,11 @@ static BLOCK_LINK *find_key_block(KEY_CACHE *keycache,
DBUG_ENTER("find_key_block"); DBUG_ENTER("find_key_block");
KEYCACHE_THREAD_TRACE("find_key_block:begin"); KEYCACHE_THREAD_TRACE("find_key_block:begin");
DBUG_PRINT("enter", ("fd: %u pos %lu wrmode: %lu", DBUG_PRINT("enter", ("fd: %d pos: %lu wrmode: %d",
(uint) file, (ulong) filepos, (uint) wrmode)); file, (ulong) filepos, wrmode));
KEYCACHE_DBUG_PRINT("find_key_block", ("fd: %u pos: %lu wrmode: %lu", KEYCACHE_DBUG_PRINT("find_key_block", ("fd: %d pos: %lu wrmode: %d",
(uint) file, (ulong) filepos, file, (ulong) filepos,
(uint) wrmode)); wrmode));
#if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) #if !defined(DBUG_OFF) && defined(EXTRA_DEBUG)
DBUG_EXECUTE("check_keycache2", DBUG_EXECUTE("check_keycache2",
test_key_cache(keycache, "start of find_key_block", 0);); test_key_cache(keycache, "start of find_key_block", 0););
@ -1641,8 +1641,8 @@ restart:
KEYCACHE_DBUG_ASSERT(page_status != -1); KEYCACHE_DBUG_ASSERT(page_status != -1);
*page_st=page_status; *page_st=page_status;
KEYCACHE_DBUG_PRINT("find_key_block", KEYCACHE_DBUG_PRINT("find_key_block",
("fd: %u pos %lu block->status %u page_status %lu", ("fd: %d pos: %lu block->status: %u page_status: %u",
(uint) file, (ulong) filepos, block->status, file, (ulong) filepos, block->status,
(uint) page_status)); (uint) page_status));
#if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) #if !defined(DBUG_OFF) && defined(EXTRA_DEBUG)
@ -2341,7 +2341,7 @@ static int flush_key_blocks_int(KEY_CACHE *keycache,
BLOCK_LINK *cache_buff[FLUSH_CACHE],**cache; BLOCK_LINK *cache_buff[FLUSH_CACHE],**cache;
int last_errno= 0; int last_errno= 0;
DBUG_ENTER("flush_key_blocks_int"); DBUG_ENTER("flush_key_blocks_int");
DBUG_PRINT("enter",("file: %d blocks_used: %d blocks_changed: %d", DBUG_PRINT("enter",("file: %d blocks_used: %lu blocks_changed: %lu",
file, keycache->blocks_used, keycache->blocks_changed)); file, keycache->blocks_used, keycache->blocks_changed));
#if !defined(DBUG_OFF) && defined(EXTRA_DEBUG) #if !defined(DBUG_OFF) && defined(EXTRA_DEBUG)
@ -2546,7 +2546,7 @@ int flush_key_blocks(KEY_CACHE *keycache,
{ {
int res; int res;
DBUG_ENTER("flush_key_blocks"); DBUG_ENTER("flush_key_blocks");
DBUG_PRINT("enter", ("keycache: 0x%lx", keycache)); DBUG_PRINT("enter", ("keycache: 0x%lx", (long) keycache));
if (keycache->disk_blocks <= 0) if (keycache->disk_blocks <= 0)
DBUG_RETURN(0); DBUG_RETURN(0);

View File

@ -159,7 +159,7 @@ static byte *safe_hash_search(SAFE_HASH *hash, const byte *key, uint length)
result= hash->default_value; result= hash->default_value;
else else
result= ((SAFE_HASH_ENTRY*) result)->data; result= ((SAFE_HASH_ENTRY*) result)->data;
DBUG_PRINT("exit",("data: 0x%lx", result)); DBUG_PRINT("exit",("data: 0x%lx", (long) result));
DBUG_RETURN(result); DBUG_RETURN(result);
} }
@ -190,7 +190,7 @@ static my_bool safe_hash_set(SAFE_HASH *hash, const byte *key, uint length,
SAFE_HASH_ENTRY *entry; SAFE_HASH_ENTRY *entry;
my_bool error= 0; my_bool error= 0;
DBUG_ENTER("safe_hash_set"); DBUG_ENTER("safe_hash_set");
DBUG_PRINT("enter",("key: %.*s data: 0x%lx", length, key, data)); DBUG_PRINT("enter",("key: %.*s data: 0x%lx", length, key, (long) data));
rw_wrlock(&hash->mutex); rw_wrlock(&hash->mutex);
entry= (SAFE_HASH_ENTRY*) hash_search(&hash->hash, key, length); entry= (SAFE_HASH_ENTRY*) hash_search(&hash->hash, key, length);

View File

@ -48,7 +48,8 @@ void init_alloc_root(MEM_ROOT *mem_root, uint block_size,
uint pre_alloc_size __attribute__((unused))) uint pre_alloc_size __attribute__((unused)))
{ {
DBUG_ENTER("init_alloc_root"); DBUG_ENTER("init_alloc_root");
DBUG_PRINT("enter",("root: 0x%lx", mem_root)); DBUG_PRINT("enter",("root: 0x%lx", (long) mem_root));
mem_root->free= mem_root->used= mem_root->pre_alloc= 0; mem_root->free= mem_root->used= mem_root->pre_alloc= 0;
mem_root->min_malloc= 32; mem_root->min_malloc= 32;
mem_root->block_size= block_size - ALLOC_ROOT_MIN_BLOCK_SIZE; mem_root->block_size= block_size - ALLOC_ROOT_MIN_BLOCK_SIZE;
@ -146,7 +147,7 @@ gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size)
#if defined(HAVE_purify) && defined(EXTRA_DEBUG) #if defined(HAVE_purify) && defined(EXTRA_DEBUG)
reg1 USED_MEM *next; reg1 USED_MEM *next;
DBUG_ENTER("alloc_root"); DBUG_ENTER("alloc_root");
DBUG_PRINT("enter",("root: 0x%lx", mem_root)); DBUG_PRINT("enter",("root: 0x%lx", (long) mem_root));
DBUG_ASSERT(alloc_root_inited(mem_root)); DBUG_ASSERT(alloc_root_inited(mem_root));
@ -160,7 +161,7 @@ gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size)
next->next= mem_root->used; next->next= mem_root->used;
next->size= Size; next->size= Size;
mem_root->used= next; mem_root->used= next;
DBUG_PRINT("exit",("ptr: 0x%lx", (((char*) next)+ DBUG_PRINT("exit",("ptr: 0x%lx", (long) (((char*) next)+
ALIGN_SIZE(sizeof(USED_MEM))))); ALIGN_SIZE(sizeof(USED_MEM)))));
DBUG_RETURN((gptr) (((char*) next)+ALIGN_SIZE(sizeof(USED_MEM)))); DBUG_RETURN((gptr) (((char*) next)+ALIGN_SIZE(sizeof(USED_MEM))));
#else #else
@ -169,7 +170,7 @@ gptr alloc_root(MEM_ROOT *mem_root,unsigned int Size)
reg1 USED_MEM *next= 0; reg1 USED_MEM *next= 0;
reg2 USED_MEM **prev; reg2 USED_MEM **prev;
DBUG_ENTER("alloc_root"); DBUG_ENTER("alloc_root");
DBUG_PRINT("enter",("root: 0x%lx", mem_root)); DBUG_PRINT("enter",("root: 0x%lx", (long) mem_root));
DBUG_ASSERT(alloc_root_inited(mem_root)); DBUG_ASSERT(alloc_root_inited(mem_root));
Size= ALIGN_SIZE(Size); Size= ALIGN_SIZE(Size);
@ -328,7 +329,7 @@ void free_root(MEM_ROOT *root, myf MyFlags)
{ {
reg1 USED_MEM *next,*old; reg1 USED_MEM *next,*old;
DBUG_ENTER("free_root"); DBUG_ENTER("free_root");
DBUG_PRINT("enter",("root: 0x%lx flags: %u", root, (uint) MyFlags)); DBUG_PRINT("enter",("root: 0x%lx flags: %u", (long) root, (uint) MyFlags));
if (!root) /* QQ: Should be deleted */ if (!root) /* QQ: Should be deleted */
DBUG_VOID_RETURN; /* purecov: inspected */ DBUG_VOID_RETURN; /* purecov: inspected */

View File

@ -29,7 +29,7 @@ File my_dup(File file, myf MyFlags)
File fd; File fd;
const char *filename; const char *filename;
DBUG_ENTER("my_dup"); DBUG_ENTER("my_dup");
DBUG_PRINT("my",("file: %d MyFlags: %d", MyFlags)); DBUG_PRINT("my",("file: %d MyFlags: %d", file, MyFlags));
fd = dup(file); fd = dup(file);
filename= (((uint) file < my_file_limit) ? filename= (((uint) file < my_file_limit) ?
my_file_info[(int) file].name : "Unknown"); my_file_info[(int) file].name : "Unknown");

View File

@ -79,7 +79,7 @@ FILE *my_fopen(const char *filename, int flags, myf MyFlags)
my_stream_opened++; my_stream_opened++;
my_file_info[fileno(fd)].type = STREAM_BY_FOPEN; my_file_info[fileno(fd)].type = STREAM_BY_FOPEN;
pthread_mutex_unlock(&THR_LOCK_open); pthread_mutex_unlock(&THR_LOCK_open);
DBUG_PRINT("exit",("stream: 0x%lx",fd)); DBUG_PRINT("exit",("stream: 0x%lx", (long) fd));
DBUG_RETURN(fd); DBUG_RETURN(fd);
} }
pthread_mutex_unlock(&THR_LOCK_open); pthread_mutex_unlock(&THR_LOCK_open);
@ -103,7 +103,7 @@ int my_fclose(FILE *fd, myf MyFlags)
{ {
int err,file; int err,file;
DBUG_ENTER("my_fclose"); DBUG_ENTER("my_fclose");
DBUG_PRINT("my",("stream: 0x%lx MyFlags: %d",fd, MyFlags)); DBUG_PRINT("my",("stream: 0x%lx MyFlags: %d", (long) fd, MyFlags));
pthread_mutex_lock(&THR_LOCK_open); pthread_mutex_lock(&THR_LOCK_open);
file=fileno(fd); file=fileno(fd);
@ -163,7 +163,7 @@ FILE *my_fdopen(File Filedes, const char *name, int Flags, myf MyFlags)
pthread_mutex_unlock(&THR_LOCK_open); pthread_mutex_unlock(&THR_LOCK_open);
} }
DBUG_PRINT("exit",("stream: 0x%lx",fd)); DBUG_PRINT("exit",("stream: 0x%lx", (long) fd));
DBUG_RETURN(fd); DBUG_RETURN(fd);
} /* my_fdopen */ } /* my_fdopen */

View File

@ -40,7 +40,7 @@ uint my_fread(FILE *stream, byte *Buffer, uint Count, myf MyFlags)
uint readbytes; uint readbytes;
DBUG_ENTER("my_fread"); DBUG_ENTER("my_fread");
DBUG_PRINT("my",("stream: 0x%lx Buffer: 0x%lx Count: %u MyFlags: %d", DBUG_PRINT("my",("stream: 0x%lx Buffer: 0x%lx Count: %u MyFlags: %d",
stream, Buffer, Count, MyFlags)); (long) stream, (long) Buffer, Count, MyFlags));
if ((readbytes = (uint) fread(Buffer,sizeof(char),(size_t) Count,stream)) if ((readbytes = (uint) fread(Buffer,sizeof(char),(size_t) Count,stream))
!= Count) != Count)
@ -81,7 +81,7 @@ uint my_fwrite(FILE *stream, const byte *Buffer, uint Count, myf MyFlags)
#endif #endif
DBUG_ENTER("my_fwrite"); DBUG_ENTER("my_fwrite");
DBUG_PRINT("my",("stream: 0x%lx Buffer: 0x%lx Count: %u MyFlags: %d", DBUG_PRINT("my",("stream: 0x%lx Buffer: 0x%lx Count: %u MyFlags: %d",
stream, Buffer, Count, MyFlags)); (long) stream, (long) Buffer, Count, MyFlags));
#if !defined(NO_BACKGROUND) && defined(USE_MY_STREAM) #if !defined(NO_BACKGROUND) && defined(USE_MY_STREAM)
errors=0; errors=0;
@ -153,7 +153,7 @@ my_off_t my_fseek(FILE *stream, my_off_t pos, int whence,
{ {
DBUG_ENTER("my_fseek"); DBUG_ENTER("my_fseek");
DBUG_PRINT("my",("stream: 0x%lx pos: %lu whence: %d MyFlags: %d", DBUG_PRINT("my",("stream: 0x%lx pos: %lu whence: %d MyFlags: %d",
stream, pos, whence, MyFlags)); (long) stream, (long) pos, whence, MyFlags));
DBUG_RETURN(fseek(stream, (off_t) pos, whence) ? DBUG_RETURN(fseek(stream, (off_t) pos, whence) ?
MY_FILEPOS_ERROR : (my_off_t) ftell(stream)); MY_FILEPOS_ERROR : (my_off_t) ftell(stream));
} /* my_seek */ } /* my_seek */
@ -166,7 +166,7 @@ my_off_t my_ftell(FILE *stream, myf MyFlags __attribute__((unused)))
{ {
off_t pos; off_t pos;
DBUG_ENTER("my_ftell"); DBUG_ENTER("my_ftell");
DBUG_PRINT("my",("stream: 0x%lx MyFlags: %d",stream, MyFlags)); DBUG_PRINT("my",("stream: 0x%lx MyFlags: %d", (long) stream, MyFlags));
pos=ftell(stream); pos=ftell(stream);
DBUG_PRINT("exit",("ftell: %lu",(ulong) pos)); DBUG_PRINT("exit",("ftell: %lu",(ulong) pos));
DBUG_RETURN((my_off_t) pos); DBUG_RETURN((my_off_t) pos);

View File

@ -37,7 +37,7 @@ int my_getwd(my_string buf, uint size, myf MyFlags)
{ {
my_string pos; my_string pos;
DBUG_ENTER("my_getwd"); DBUG_ENTER("my_getwd");
DBUG_PRINT("my",("buf: 0x%lx size: %d MyFlags %d", buf,size,MyFlags)); DBUG_PRINT("my",("buf: 0x%lx size: %d MyFlags %d", (long) buf,size,MyFlags));
if (curr_dir[0]) /* Current pos is saved here */ if (curr_dir[0]) /* Current pos is saved here */
VOID(strmake(buf,&curr_dir[0],size-1)); VOID(strmake(buf,&curr_dir[0],size-1));

View File

@ -529,7 +529,7 @@ MY_STAT *my_stat(const char *path, MY_STAT *stat_area, myf my_flags)
int m_used; int m_used;
DBUG_ENTER("my_stat"); DBUG_ENTER("my_stat");
DBUG_PRINT("my", ("path: '%s', stat_area: 0x%lx, MyFlags: %d", path, DBUG_PRINT("my", ("path: '%s', stat_area: 0x%lx, MyFlags: %d", path,
(byte *) stat_area, my_flags)); (long) stat_area, my_flags));
if ((m_used= (stat_area == NULL))) if ((m_used= (stat_area == NULL)))
if (!(stat_area = (MY_STAT *) my_malloc(sizeof(MY_STAT), my_flags))) if (!(stat_area = (MY_STAT *) my_malloc(sizeof(MY_STAT), my_flags)))

View File

@ -44,7 +44,7 @@ gptr my_malloc(unsigned int size, myf my_flags)
} }
else if (my_flags & MY_ZEROFILL) else if (my_flags & MY_ZEROFILL)
bzero(point,size); bzero(point,size);
DBUG_PRINT("exit",("ptr: 0x%lx",point)); DBUG_PRINT("exit",("ptr: 0x%lx", (long) point));
DBUG_RETURN(point); DBUG_RETURN(point);
} /* my_malloc */ } /* my_malloc */
@ -55,7 +55,7 @@ gptr my_malloc(unsigned int size, myf my_flags)
void my_no_flags_free(gptr ptr) void my_no_flags_free(gptr ptr)
{ {
DBUG_ENTER("my_free"); DBUG_ENTER("my_free");
DBUG_PRINT("my",("ptr: 0x%lx",ptr)); DBUG_PRINT("my",("ptr: 0x%lx", (long) ptr));
if (ptr) if (ptr)
free(ptr); free(ptr);
DBUG_VOID_RETURN; DBUG_VOID_RETURN;

View File

@ -30,7 +30,7 @@ uint my_pread(File Filedes, byte *Buffer, uint Count, my_off_t offset,
int error= 0; int error= 0;
DBUG_ENTER("my_pread"); DBUG_ENTER("my_pread");
DBUG_PRINT("my",("Fd: %d Seek: %lu Buffer: 0x%lx Count: %u MyFlags: %d", DBUG_PRINT("my",("Fd: %d Seek: %lu Buffer: 0x%lx Count: %u MyFlags: %d",
Filedes, (ulong) offset, Buffer, Count, MyFlags)); Filedes, (ulong) offset, (long) Buffer, Count, MyFlags));
for (;;) for (;;)
{ {
@ -72,8 +72,8 @@ uint my_pread(File Filedes, byte *Buffer, uint Count, my_off_t offset,
#endif #endif
if (error || readbytes != Count) if (error || readbytes != Count)
{ {
DBUG_PRINT("warning",("Read only %ld bytes off %ld from %d, errno: %d", DBUG_PRINT("warning",("Read only %d bytes off %u from %d, errno: %d",
readbytes,Count,Filedes,my_errno)); (int) readbytes, Count,Filedes,my_errno));
#ifdef THREAD #ifdef THREAD
if ((readbytes == 0 || (int) readbytes == -1) && errno == EINTR) if ((readbytes == 0 || (int) readbytes == -1) && errno == EINTR)
{ {
@ -110,7 +110,7 @@ uint my_pwrite(int Filedes, const byte *Buffer, uint Count, my_off_t offset,
ulong written; ulong written;
DBUG_ENTER("my_pwrite"); DBUG_ENTER("my_pwrite");
DBUG_PRINT("my",("Fd: %d Seek: %lu Buffer: 0x%lx Count: %d MyFlags: %d", DBUG_PRINT("my",("Fd: %d Seek: %lu Buffer: 0x%lx Count: %d MyFlags: %d",
Filedes, (ulong) offset,Buffer, Count, MyFlags)); Filedes, (ulong) offset, (long) Buffer, Count, MyFlags));
errors=0; written=0L; errors=0; written=0L;
for (;;) for (;;)

View File

@ -39,7 +39,7 @@ uint my_read(File Filedes, byte *Buffer, uint Count, myf MyFlags)
uint readbytes, save_count; uint readbytes, save_count;
DBUG_ENTER("my_read"); DBUG_ENTER("my_read");
DBUG_PRINT("my",("Fd: %d Buffer: 0x%lx Count: %u MyFlags: %d", DBUG_PRINT("my",("Fd: %d Buffer: 0x%lx Count: %u MyFlags: %d",
Filedes, Buffer, Count, MyFlags)); Filedes, (long) Buffer, Count, MyFlags));
save_count= Count; save_count= Count;
for (;;) for (;;)
@ -48,8 +48,8 @@ uint my_read(File Filedes, byte *Buffer, uint Count, myf MyFlags)
if ((readbytes= (uint) read(Filedes, Buffer, Count)) != Count) if ((readbytes= (uint) read(Filedes, Buffer, Count)) != Count)
{ {
my_errno= errno ? errno : -1; my_errno= errno ? errno : -1;
DBUG_PRINT("warning",("Read only %ld bytes off %ld from %d, errno: %d", DBUG_PRINT("warning",("Read only %d bytes off %u from %d, errno: %d",
readbytes, Count, Filedes, my_errno)); (int) readbytes, Count, Filedes, my_errno));
#ifdef THREAD #ifdef THREAD
if ((readbytes == 0 || (int) readbytes == -1) && errno == EINTR) if ((readbytes == 0 || (int) readbytes == -1) && errno == EINTR)
{ {

View File

@ -27,7 +27,7 @@ gptr my_realloc(gptr oldpoint, uint size, myf my_flags)
{ {
gptr point; gptr point;
DBUG_ENTER("my_realloc"); DBUG_ENTER("my_realloc");
DBUG_PRINT("my",("ptr: 0x%lx size: %u my_flags: %d",oldpoint, size, DBUG_PRINT("my",("ptr: 0x%lx size: %u my_flags: %d", (long) oldpoint, size,
my_flags)); my_flags));
if (!oldpoint && (my_flags & MY_ALLOW_ZERO_PTR)) if (!oldpoint && (my_flags & MY_ALLOW_ZERO_PTR))
@ -60,6 +60,6 @@ gptr my_realloc(gptr oldpoint, uint size, myf my_flags)
my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG), size); my_error(EE_OUTOFMEMORY, MYF(ME_BELL+ME_WAITTANG), size);
} }
#endif #endif
DBUG_PRINT("exit",("ptr: 0x%lx",point)); DBUG_PRINT("exit",("ptr: 0x%lx", (long) point));
DBUG_RETURN(point); DBUG_RETURN(point);
} /* my_realloc */ } /* my_realloc */

View File

@ -61,7 +61,7 @@ my_off_t my_seek(File fd, my_off_t pos, int whence,
if (newpos == (os_off_t) -1) if (newpos == (os_off_t) -1)
{ {
my_errno=errno; my_errno=errno;
DBUG_PRINT("error",("lseek: %lu, errno: %d",newpos,errno)); DBUG_PRINT("error",("lseek: %lu, errno: %d", (ulong) newpos,errno));
DBUG_RETURN(MY_FILEPOS_ERROR); DBUG_RETURN(MY_FILEPOS_ERROR);
} }
if ((my_off_t) newpos != pos) if ((my_off_t) newpos != pos)

View File

@ -27,7 +27,7 @@ uint my_write(int Filedes, const byte *Buffer, uint Count, myf MyFlags)
ulong written; ulong written;
DBUG_ENTER("my_write"); DBUG_ENTER("my_write");
DBUG_PRINT("my",("Fd: %d Buffer: 0x%lx Count: %d MyFlags: %d", DBUG_PRINT("my",("Fd: %d Buffer: 0x%lx Count: %d MyFlags: %d",
Filedes, Buffer, Count, MyFlags)); Filedes, (long) Buffer, Count, MyFlags));
errors=0; written=0L; errors=0; written=0L;
for (;;) for (;;)

View File

@ -194,7 +194,7 @@ gptr _mymalloc(uint size, const char *filename, uint lineno, myf MyFlags)
if ((MyFlags & MY_ZEROFILL) || !sf_malloc_quick) if ((MyFlags & MY_ZEROFILL) || !sf_malloc_quick)
bfill(data, size, (char) (MyFlags & MY_ZEROFILL ? 0 : ALLOC_VAL)); bfill(data, size, (char) (MyFlags & MY_ZEROFILL ? 0 : ALLOC_VAL));
/* Return a pointer to the real data */ /* Return a pointer to the real data */
DBUG_PRINT("exit",("ptr: 0x%lx", data)); DBUG_PRINT("exit",("ptr: 0x%lx", (long) data));
if (sf_min_adress > data) if (sf_min_adress > data)
sf_min_adress= data; sf_min_adress= data;
if (sf_max_adress < data) if (sf_max_adress < data)
@ -259,7 +259,7 @@ void _myfree(gptr ptr, const char *filename, uint lineno, myf myflags)
{ {
struct st_irem *irem; struct st_irem *irem;
DBUG_ENTER("_myfree"); DBUG_ENTER("_myfree");
DBUG_PRINT("enter",("ptr: 0x%lx", ptr)); DBUG_PRINT("enter",("ptr: 0x%lx", (long) ptr));
if (!sf_malloc_quick) if (!sf_malloc_quick)
(void) _sanity (filename, lineno); (void) _sanity (filename, lineno);
@ -410,7 +410,7 @@ void TERMINATE(FILE *file)
} }
DBUG_PRINT("safe", DBUG_PRINT("safe",
("%6u bytes at 0x%09lx, allocated at line %4d in '%s'", ("%6u bytes at 0x%09lx, allocated at line %4d in '%s'",
irem->datasize, data, irem->linenum, irem->filename)); irem->datasize, (long) data, irem->linenum, irem->filename));
irem= irem->next; irem= irem->next;
} }
} }
@ -447,7 +447,7 @@ static int _checkchunk(register struct st_irem *irem, const char *filename,
fprintf(stderr, " discovered at %s:%d\n", filename, lineno); fprintf(stderr, " discovered at %s:%d\n", filename, lineno);
(void) fflush(stderr); (void) fflush(stderr);
DBUG_PRINT("safe",("Underrun at 0x%lx, allocated at %s:%d", DBUG_PRINT("safe",("Underrun at 0x%lx, allocated at %s:%d",
data, irem->filename, irem->linenum)); (long) data, irem->filename, irem->linenum));
flag=1; flag=1;
} }
@ -463,7 +463,7 @@ static int _checkchunk(register struct st_irem *irem, const char *filename,
fprintf(stderr, " discovered at '%s:%d'\n", filename, lineno); fprintf(stderr, " discovered at '%s:%d'\n", filename, lineno);
(void) fflush(stderr); (void) fflush(stderr);
DBUG_PRINT("safe",("Overrun at 0x%lx, allocated at %s:%d", DBUG_PRINT("safe",("Overrun at 0x%lx, allocated at %s:%d",
data, (long) data,
irem->filename, irem->filename,
irem->linenum)); irem->linenum));
flag=1; flag=1;

View File

@ -483,8 +483,8 @@ thr_lock(THR_LOCK_DATA *data, THR_LOCK_OWNER *owner,
data->owner= owner; /* Must be reset ! */ data->owner= owner; /* Must be reset ! */
VOID(pthread_mutex_lock(&lock->mutex)); VOID(pthread_mutex_lock(&lock->mutex));
DBUG_PRINT("lock",("data: 0x%lx thread: 0x%lx lock: 0x%lx type: %d", DBUG_PRINT("lock",("data: 0x%lx thread: 0x%lx lock: 0x%lx type: %d",
data, data->owner->info->thread_id, (long) data, data->owner->info->thread_id,
lock, (int) lock_type)); (long) lock, (int) lock_type));
check_locks(lock,(uint) lock_type <= (uint) TL_READ_NO_INSERT ? check_locks(lock,(uint) lock_type <= (uint) TL_READ_NO_INSERT ?
"enter read_lock" : "enter write_lock",0); "enter read_lock" : "enter write_lock",0);
if ((int) lock_type <= (int) TL_READ_NO_INSERT) if ((int) lock_type <= (int) TL_READ_NO_INSERT)
@ -659,7 +659,7 @@ thr_lock(THR_LOCK_DATA *data, THR_LOCK_OWNER *owner,
goto end; goto end;
} }
} }
DBUG_PRINT("lock",("write locked by thread: 0x%lx, type: %ld", DBUG_PRINT("lock",("write locked by thread: 0x%lx, type: %d",
lock->read.data->owner->info->thread_id, data->type)); lock->read.data->owner->info->thread_id, data->type));
} }
wait_queue= &lock->write_wait; wait_queue= &lock->write_wait;
@ -740,7 +740,7 @@ void thr_unlock(THR_LOCK_DATA *data)
enum thr_lock_type lock_type=data->type; enum thr_lock_type lock_type=data->type;
DBUG_ENTER("thr_unlock"); DBUG_ENTER("thr_unlock");
DBUG_PRINT("lock",("data: 0x%lx thread: 0x%lx lock: 0x%lx", DBUG_PRINT("lock",("data: 0x%lx thread: 0x%lx lock: 0x%lx",
data, data->owner->info->thread_id, lock)); (long) data, data->owner->info->thread_id, (long) lock));
pthread_mutex_lock(&lock->mutex); pthread_mutex_lock(&lock->mutex);
check_locks(lock,"start of release lock",0); check_locks(lock,"start of release lock",0);
@ -913,7 +913,7 @@ thr_multi_lock(THR_LOCK_DATA **data, uint count, THR_LOCK_OWNER *owner)
{ {
THR_LOCK_DATA **pos,**end; THR_LOCK_DATA **pos,**end;
DBUG_ENTER("thr_multi_lock"); DBUG_ENTER("thr_multi_lock");
DBUG_PRINT("lock",("data: 0x%lx count: %d",data,count)); DBUG_PRINT("lock",("data: 0x%lx count: %d", (long) data, count));
if (count > 1) if (count > 1)
sort_locks(data,count); sort_locks(data,count);
/* lock everything */ /* lock everything */
@ -986,7 +986,7 @@ void thr_multi_unlock(THR_LOCK_DATA **data,uint count)
{ {
THR_LOCK_DATA **pos,**end; THR_LOCK_DATA **pos,**end;
DBUG_ENTER("thr_multi_unlock"); DBUG_ENTER("thr_multi_unlock");
DBUG_PRINT("lock",("data: 0x%lx count: %d",data,count)); DBUG_PRINT("lock",("data: 0x%lx count: %d", (long) data, count));
for (pos=data,end=data+count; pos < end ; pos++) for (pos=data,end=data+count; pos < end ; pos++)
{ {
@ -1000,7 +1000,8 @@ void thr_multi_unlock(THR_LOCK_DATA **data,uint count)
else else
{ {
DBUG_PRINT("lock",("Free lock: data: 0x%lx thread: %ld lock: 0x%lx", DBUG_PRINT("lock",("Free lock: data: 0x%lx thread: %ld lock: 0x%lx",
*pos, (*pos)->owner->info->thread_id, (*pos)->lock)); (long) *pos, (*pos)->owner->info->thread_id,
(long) (*pos)->lock));
} }
} }
DBUG_VOID_RETURN; DBUG_VOID_RETURN;

View File

@ -89,7 +89,7 @@ void init_tree(TREE *tree, uint default_alloc_size, uint memory_limit,
tree_element_free free_element, void *custom_arg) tree_element_free free_element, void *custom_arg)
{ {
DBUG_ENTER("init_tree"); DBUG_ENTER("init_tree");
DBUG_PRINT("enter",("tree: 0x%lx size: %d",tree,size)); DBUG_PRINT("enter",("tree: 0x%lx size: %d", (long) tree, size));
if (default_alloc_size < DEFAULT_ALLOC_SIZE) if (default_alloc_size < DEFAULT_ALLOC_SIZE)
default_alloc_size= DEFAULT_ALLOC_SIZE; default_alloc_size= DEFAULT_ALLOC_SIZE;
@ -137,7 +137,7 @@ void init_tree(TREE *tree, uint default_alloc_size, uint memory_limit,
static void free_tree(TREE *tree, myf free_flags) static void free_tree(TREE *tree, myf free_flags)
{ {
DBUG_ENTER("free_tree"); DBUG_ENTER("free_tree");
DBUG_PRINT("enter",("tree: 0x%lx",tree)); DBUG_PRINT("enter",("tree: 0x%lx", (long) tree));
if (tree->root) /* If initialized */ if (tree->root) /* If initialized */
{ {

View File

@ -49,7 +49,7 @@ int find_type(my_string x, TYPELIB *typelib, uint full_name)
reg1 my_string i; reg1 my_string i;
reg2 const char *j; reg2 const char *j;
DBUG_ENTER("find_type"); DBUG_ENTER("find_type");
DBUG_PRINT("enter",("x: '%s' lib: 0x%lx",x,typelib)); DBUG_PRINT("enter",("x: '%s' lib: 0x%lx", x, (long) typelib));
if (!typelib->count) if (!typelib->count)
{ {

View File

@ -15,7 +15,8 @@
#include "utils.h" #include "utils.h"
#include "regex2.h" #include "regex2.h"
static int nope = 0; /* for use in asserts; shuts lint up */ /* for use in asserts */
#define nope 0
/* macros for manipulating states, small version */ /* macros for manipulating states, small version */
#define states long #define states long

View File

@ -165,7 +165,7 @@ Mysql_connection_thread::~Mysql_connection_thread()
void Mysql_connection_thread::run() void Mysql_connection_thread::run()
{ {
log_info("accepted mysql connection %lu", (unsigned long) connection_id); log_info("accepted mysql connection %lu", connection_id);
my_thread_init(); my_thread_init();
@ -175,8 +175,7 @@ void Mysql_connection_thread::run()
return; return;
} }
log_info("connection %lu is checked successfully", log_info("connection %lu is checked successfully", connection_id);
(unsigned long) connection_id);
vio_keepalive(vio, TRUE); vio_keepalive(vio, TRUE);
@ -315,8 +314,8 @@ int Mysql_connection_thread::do_command()
packet= (char*) net.read_pos; packet= (char*) net.read_pos;
enum enum_server_command command= (enum enum_server_command) enum enum_server_command command= (enum enum_server_command)
(uchar) *packet; (uchar) *packet;
log_info("connection %lu: packet_length=%lu, command=%d", log_info("connection: %lu packet_length: %lu command: %d",
(int) connection_id, (int) packet_length, (int) command); connection_id, packet_length, command);
return dispatch_command(command, packet + 1, packet_length - 1); return dispatch_command(command, packet + 1, packet_length - 1);
} }
} }
@ -326,33 +325,28 @@ int Mysql_connection_thread::dispatch_command(enum enum_server_command command,
{ {
switch (command) { switch (command) {
case COM_QUIT: // client exit case COM_QUIT: // client exit
log_info("query for connection %lu received quit command", log_info("query for connection %lu received quit command", connection_id);
(unsigned long) connection_id);
return 1; return 1;
case COM_PING: case COM_PING:
log_info("query for connection %lu received ping command", log_info("query for connection %lu received ping command", connection_id);
(unsigned long) connection_id);
net_send_ok(&net, connection_id, NULL); net_send_ok(&net, connection_id, NULL);
break; break;
case COM_QUERY: case COM_QUERY:
{ {
log_info("query for connection %lu : ----\n%s\n-------------------------", log_info("query for connection %lu : ----\n%s\n-------------------------",
(int) connection_id, log_info("query for connection %d : ----\n%s\n-------------------------",
(const char *) packet); connection_id,packet);
if (Command *command= parse_command(&instance_map, packet)) if (Command *command= parse_command(&instance_map, packet))
{ {
int res= 0; int res= 0;
log_info("query for connection %lu successfully parsed", log_info("query for connection %lu successefully parsed",connection_id);
(unsigned long) connection_id);
res= command->execute(&net, connection_id); res= command->execute(&net, connection_id);
delete command; delete command;
if (!res) if (!res)
log_info("query for connection %lu executed ok", log_info("query for connection %lu executed ok",connection_id);
(unsigned long) connection_id);
else else
{ {
log_info("query for connection %lu executed err=%d", log_info("query for connection %lu executed err=%d",connection_id,res);
(unsigned long) connection_id, (int) res);
net_send_error(&net, res); net_send_error(&net, res);
return 0; return 0;
} }
@ -365,8 +359,7 @@ int Mysql_connection_thread::dispatch_command(enum enum_server_command command,
break; break;
} }
default: default:
log_info("query for connection %lu received unknown command", log_info("query for connection %lu received unknown command",connection_id);
(unsigned long) connection_id);
net_send_error(&net, ER_UNKNOWN_COM_ERROR); net_send_error(&net, ER_UNKNOWN_COM_ERROR);
break; break;
} }

View File

@ -593,7 +593,7 @@ cli_safe_read(MYSQL *mysql)
if (len == packet_error || len == 0) if (len == packet_error || len == 0)
{ {
DBUG_PRINT("error",("Wrong connection or packet. fd: %s len: %d", DBUG_PRINT("error",("Wrong connection or packet. fd: %s len: %lu",
vio_description(net->vio),len)); vio_description(net->vio),len));
#ifdef MYSQL_SERVER #ifdef MYSQL_SERVER
if (net->vio && vio_was_interrupted(net->vio)) if (net->vio && vio_was_interrupted(net->vio))
@ -865,7 +865,7 @@ void STDCALL
mysql_free_result(MYSQL_RES *result) mysql_free_result(MYSQL_RES *result)
{ {
DBUG_ENTER("mysql_free_result"); DBUG_ENTER("mysql_free_result");
DBUG_PRINT("enter",("mysql_res: %lx",result)); DBUG_PRINT("enter",("mysql_res: 0x%lx", (long) result));
if (result) if (result)
{ {
MYSQL *mysql= result->handle; MYSQL *mysql= result->handle;
@ -1361,7 +1361,7 @@ MYSQL_DATA *cli_read_rows(MYSQL *mysql,MYSQL_FIELD *mysql_fields,
DBUG_PRINT("info",("status: %u warning_count: %u", DBUG_PRINT("info",("status: %u warning_count: %u",
mysql->server_status, mysql->warning_count)); mysql->server_status, mysql->warning_count));
} }
DBUG_PRINT("exit",("Got %d rows",result->rows)); DBUG_PRINT("exit", ("Got %lu rows", (ulong) result->rows));
DBUG_RETURN(result); DBUG_RETURN(result);
} }
@ -2319,7 +2319,7 @@ CLI_MYSQL_REAL_CONNECT(MYSQL *mysql,const char *host, const char *user,
goto error; goto error;
#endif #endif
DBUG_PRINT("exit",("Mysql handler: %lx",mysql)); DBUG_PRINT("exit", ("Mysql handler: 0x%lx", (long) mysql));
reset_sigpipe(mysql); reset_sigpipe(mysql);
DBUG_RETURN(mysql); DBUG_RETURN(mysql);
@ -2692,7 +2692,7 @@ int STDCALL
mysql_real_query(MYSQL *mysql, const char *query, ulong length) mysql_real_query(MYSQL *mysql, const char *query, ulong length)
{ {
DBUG_ENTER("mysql_real_query"); DBUG_ENTER("mysql_real_query");
DBUG_PRINT("enter",("handle: %lx",mysql)); DBUG_PRINT("enter",("handle: 0x%lx", (long) mysql));
DBUG_PRINT("query",("Query = '%-.4096s'",query)); DBUG_PRINT("query",("Query = '%-.4096s'",query));
if (mysql_send_query(mysql,query,length)) if (mysql_send_query(mysql,query,length))

View File

@ -963,7 +963,7 @@ my_system_gmt_sec(const MYSQL_TIME *t_src, long *my_timezone,
*/ */
if ((tmp < TIMESTAMP_MIN_VALUE) || (tmp > TIMESTAMP_MAX_VALUE)) if ((tmp < TIMESTAMP_MIN_VALUE) || (tmp > TIMESTAMP_MAX_VALUE))
tmp= 0; tmp= 0;
end:
return (my_time_t) tmp; return (my_time_t) tmp;
} /* my_system_gmt_sec */ } /* my_system_gmt_sec */

View File

@ -302,7 +302,7 @@ ha_rows filesort(THD *thd, TABLE *table, SORT_FIELD *sortorder, uint s_length,
DBUG_POP(); /* Ok to DBUG */ DBUG_POP(); /* Ok to DBUG */
#endif #endif
memcpy(&table->sort, &table_sort, sizeof(FILESORT_INFO)); memcpy(&table->sort, &table_sort, sizeof(FILESORT_INFO));
DBUG_PRINT("exit",("records: %ld",records)); DBUG_PRINT("exit",("records: %ld", (long) records));
DBUG_RETURN(error ? HA_POS_ERROR : records); DBUG_RETURN(error ? HA_POS_ERROR : records);
} /* filesort */ } /* filesort */

View File

@ -2072,7 +2072,7 @@ inline int ha_ndbcluster::fetch_next(NdbScanOperation* cursor)
all pending update or delete operations should all pending update or delete operations should
be sent to NDB be sent to NDB
*/ */
DBUG_PRINT("info", ("ops_pending: %d", m_ops_pending)); DBUG_PRINT("info", ("ops_pending: %ld", (long) m_ops_pending));
if (m_ops_pending) if (m_ops_pending)
{ {
if (m_transaction_on) if (m_transaction_on)
@ -3480,7 +3480,7 @@ int ha_ndbcluster::close_scan()
Take over any pending transactions to the Take over any pending transactions to the
deleteing/updating transaction before closing the scan deleteing/updating transaction before closing the scan
*/ */
DBUG_PRINT("info", ("ops_pending: %d", m_ops_pending)); DBUG_PRINT("info", ("ops_pending: %ld", (long) m_ops_pending));
if (execute_no_commit(this,trans,false) != 0) { if (execute_no_commit(this,trans,false) != 0) {
no_uncommitted_rows_execute_failure(); no_uncommitted_rows_execute_failure();
DBUG_RETURN(ndb_err(trans)); DBUG_RETURN(ndb_err(trans));
@ -4286,8 +4286,8 @@ static int ndbcluster_commit(handlerton *hton, THD *thd, bool all)
while ((share= it++)) while ((share= it++))
{ {
pthread_mutex_lock(&share->mutex); pthread_mutex_lock(&share->mutex);
DBUG_PRINT("info", ("Invalidate commit_count for %s, share->commit_count: %d ", DBUG_PRINT("info", ("Invalidate commit_count for %s, share->commit_count: %lu",
share->key, share->commit_count)); share->table_name, (ulong) share->commit_count));
share->commit_count= 0; share->commit_count= 0;
share->commit_count_lock++; share->commit_count_lock++;
pthread_mutex_unlock(&share->mutex); pthread_mutex_unlock(&share->mutex);
@ -4690,8 +4690,7 @@ int ha_ndbcluster::create(const char *name,
my_free((char*)data, MYF(0)); my_free((char*)data, MYF(0));
DBUG_RETURN(2); DBUG_RETURN(2);
} }
DBUG_PRINT("info", ("setFrm data: 0x%lx len: %d", (long) pack_data, pack_length));
DBUG_PRINT("info", ("setFrm data=%lx len=%d", pack_data, pack_length));
tab.setFrm(pack_data, pack_length); tab.setFrm(pack_data, pack_length);
my_free((char*)data, MYF(0)); my_free((char*)data, MYF(0));
my_free((char*)pack_data, MYF(0)); my_free((char*)pack_data, MYF(0));
@ -7472,11 +7471,11 @@ NDB_SHARE *ndbcluster_get_share(const char *key, TABLE *table,
DBUG_PRINT("info", DBUG_PRINT("info",
("0x%lx key: %s key_length: %d key: %s", ("0x%lx key: %s key_length: %d key: %s",
share, share->key, share->key_length, key)); (long) share, share->key, share->key_length, key));
DBUG_PRINT("info", DBUG_PRINT("info",
("db.tablename: %s.%s use_count: %d commit_count: %d", ("db.tablename: %s.%s use_count: %d commit_count: %lu",
share->db, share->table_name, share->db, share->table_name,
share->use_count, share->commit_count)); share->use_count, (ulong) share->commit_count));
if (!have_lock) if (!have_lock)
pthread_mutex_unlock(&ndbcluster_mutex); pthread_mutex_unlock(&ndbcluster_mutex);
DBUG_RETURN(share); DBUG_RETURN(share);
@ -8182,7 +8181,7 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
my_thread_init(); my_thread_init();
DBUG_ENTER("ndb_util_thread"); DBUG_ENTER("ndb_util_thread");
DBUG_PRINT("enter", ("ndb_cache_check_time: %d", ndb_cache_check_time)); DBUG_PRINT("enter", ("ndb_cache_check_time: %lu", ndb_cache_check_time));
thd= new THD; /* note that contructor of THD uses DBUG_ */ thd= new THD; /* note that contructor of THD uses DBUG_ */
THD_CHECK_SENTRY(thd); THD_CHECK_SENTRY(thd);
@ -8270,7 +8269,7 @@ pthread_handler_t ndb_util_thread_func(void *arg __attribute__((unused)))
&abstime); &abstime);
pthread_mutex_unlock(&LOCK_ndb_util_thread); pthread_mutex_unlock(&LOCK_ndb_util_thread);
#ifdef NDB_EXTRA_DEBUG_UTIL_THREAD #ifdef NDB_EXTRA_DEBUG_UTIL_THREAD
DBUG_PRINT("ndb_util_thread", ("Started, ndb_cache_check_time: %d", DBUG_PRINT("ndb_util_thread", ("Started, ndb_cache_check_time: %lu",
ndb_cache_check_time)); ndb_cache_check_time));
#endif #endif
if (abort_loop) if (abort_loop)
@ -9191,7 +9190,7 @@ void ndb_serialize_cond(const Item *item, void *arg)
if (context->expecting(Item::INT_ITEM)) if (context->expecting(Item::INT_ITEM))
{ {
Item_int *int_item= (Item_int *) item; Item_int *int_item= (Item_int *) item;
DBUG_PRINT("info", ("value %d", int_item->value)); DBUG_PRINT("info", ("value %ld", (long) int_item->value));
NDB_ITEM_QUALIFICATION q; NDB_ITEM_QUALIFICATION q;
q.value_type= Item::INT_ITEM; q.value_type= Item::INT_ITEM;
curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item); curr_cond->ndb_item= new Ndb_item(NDB_VALUE, q, item);
@ -9214,7 +9213,7 @@ void ndb_serialize_cond(const Item *item, void *arg)
context->supported= FALSE; context->supported= FALSE;
break; break;
case Item::REAL_ITEM: case Item::REAL_ITEM:
DBUG_PRINT("info", ("REAL_ITEM %s")); DBUG_PRINT("info", ("REAL_ITEM"));
if (context->expecting(Item::REAL_ITEM)) if (context->expecting(Item::REAL_ITEM))
{ {
Item_float *float_item= (Item_float *) item; Item_float *float_item= (Item_float *) item;
@ -9262,7 +9261,7 @@ void ndb_serialize_cond(const Item *item, void *arg)
context->supported= FALSE; context->supported= FALSE;
break; break;
case Item::DECIMAL_ITEM: case Item::DECIMAL_ITEM:
DBUG_PRINT("info", ("DECIMAL_ITEM %s")); DBUG_PRINT("info", ("DECIMAL_ITEM"));
if (context->expecting(Item::DECIMAL_ITEM)) if (context->expecting(Item::DECIMAL_ITEM))
{ {
Item_decimal *decimal_item= (Item_decimal *) item; Item_decimal *decimal_item= (Item_decimal *) item;

View File

@ -1654,7 +1654,7 @@ prev_insert_id(ulonglong nr, struct system_variables *variables)
*/ */
DBUG_PRINT("info",("auto_increment: nr: %lu cannot honour " DBUG_PRINT("info",("auto_increment: nr: %lu cannot honour "
"auto_increment_offset: %lu", "auto_increment_offset: %lu",
nr, variables->auto_increment_offset)); (ulong) nr, variables->auto_increment_offset));
return nr; return nr;
} }
if (variables->auto_increment_increment == 1) if (variables->auto_increment_increment == 1)

View File

@ -2229,7 +2229,7 @@ cmp_item* cmp_item_row::make_same()
cmp_item_row::~cmp_item_row() cmp_item_row::~cmp_item_row()
{ {
DBUG_ENTER("~cmp_item_row"); DBUG_ENTER("~cmp_item_row");
DBUG_PRINT("enter",("this: 0x%lx", this)); DBUG_PRINT("enter",("this: 0x%lx", (long) this));
if (comparators) if (comparators)
{ {
for (uint i= 0; i < n; i++) for (uint i= 0; i < n; i++)
@ -3061,7 +3061,7 @@ longlong Item_is_not_null_test::val_int()
if (!used_tables_cache) if (!used_tables_cache)
{ {
owner->was_null|= (!cached_value); owner->was_null|= (!cached_value);
DBUG_PRINT("info", ("cached :%d", cached_value)); DBUG_PRINT("info", ("cached :%ld", (long) cached_value));
DBUG_RETURN(cached_value); DBUG_RETURN(cached_value);
} }
if (args[0]->is_null()) if (args[0]->is_null())

View File

@ -54,7 +54,7 @@ void Item_subselect::init(st_select_lex *select_lex,
{ {
DBUG_ENTER("Item_subselect::init"); DBUG_ENTER("Item_subselect::init");
DBUG_PRINT("enter", ("select_lex: 0x%x", (ulong) select_lex)); DBUG_PRINT("enter", ("select_lex: 0x%lx", (long) select_lex));
unit= select_lex->master_unit(); unit= select_lex->master_unit();
if (unit->item) if (unit->item)

View File

@ -2385,7 +2385,8 @@ String *Item_char_typecast::val_str(String *str)
{ // Safe even if const arg { // Safe even if const arg
char char_type[40]; char char_type[40];
my_snprintf(char_type, sizeof(char_type), "%s(%lu)", my_snprintf(char_type, sizeof(char_type), "%s(%lu)",
cast_cs == &my_charset_bin ? "BINARY" : "CHAR", (ulong) length); cast_cs == &my_charset_bin ? "BINARY" : "CHAR",
(ulong) length);
if (!res->alloced_length()) if (!res->alloced_length())
{ // Don't change const str { // Don't change const str

View File

@ -846,7 +846,7 @@ Log_event* Log_event::read_log_event(IO_CACHE* file,
LOG_EVENT_MINIMAL_HEADER_LEN); LOG_EVENT_MINIMAL_HEADER_LEN);
LOCK_MUTEX; LOCK_MUTEX;
DBUG_PRINT("info", ("my_b_tell=%lu", my_b_tell(file))); DBUG_PRINT("info", ("my_b_tell: %lu", (ulong) my_b_tell(file)));
if (my_b_read(file, (byte *) head, header_size)) if (my_b_read(file, (byte *) head, header_size))
{ {
DBUG_PRINT("info", ("Log_event::read_log_event(IO_CACHE*,Format_desc*) \ DBUG_PRINT("info", ("Log_event::read_log_event(IO_CACHE*,Format_desc*) \
@ -1499,7 +1499,8 @@ Query_log_event::Query_log_event(THD* thd_arg, const char* query_arg,
} }
else else
time_zone_len= 0; time_zone_len= 0;
DBUG_PRINT("info",("Query_log_event has flags2=%lu sql_mode=%lu",flags2,sql_mode)); DBUG_PRINT("info",("Query_log_event has flags2: %lu sql_mode: %lu",
(ulong) flags2, sql_mode));
} }
#endif /* MYSQL_CLIENT */ #endif /* MYSQL_CLIENT */
@ -1547,7 +1548,7 @@ Query_log_event::Query_log_event(const char* buf, uint event_len,
common_header_len= description_event->common_header_len; common_header_len= description_event->common_header_len;
post_header_len= description_event->post_header_len[event_type-1]; post_header_len= description_event->post_header_len[event_type-1];
DBUG_PRINT("info",("event_len=%ld, common_header_len=%d, post_header_len=%d", DBUG_PRINT("info",("event_len: %u common_header_len: %d post_header_len: %d",
event_len, common_header_len, post_header_len)); event_len, common_header_len, post_header_len));
/* /*
@ -1595,7 +1596,7 @@ Query_log_event::Query_log_event(const char* buf, uint event_len,
case Q_FLAGS2_CODE: case Q_FLAGS2_CODE:
flags2_inited= 1; flags2_inited= 1;
flags2= uint4korr(pos); flags2= uint4korr(pos);
DBUG_PRINT("info",("In Query_log_event, read flags2: %lu", flags2)); DBUG_PRINT("info",("In Query_log_event, read flags2: %lu", (ulong) flags2));
pos+= 4; pos+= 4;
break; break;
case Q_SQL_MODE_CODE: case Q_SQL_MODE_CODE:
@ -3370,8 +3371,8 @@ Rotate_log_event::Rotate_log_event(const char* new_log_ident_arg,
#ifndef DBUG_OFF #ifndef DBUG_OFF
char buff[22]; char buff[22];
DBUG_ENTER("Rotate_log_event::Rotate_log_event(...,flags)"); DBUG_ENTER("Rotate_log_event::Rotate_log_event(...,flags)");
DBUG_PRINT("enter",("new_log_ident %s pos %s flags %lu", new_log_ident_arg, DBUG_PRINT("enter",("new_log_ident: %s pos: %s flags: %lu", new_log_ident_arg,
llstr(pos_arg, buff), flags)); llstr(pos_arg, buff), (ulong) flags));
#endif #endif
if (flags & DUP_NAME) if (flags & DUP_NAME)
new_log_ident= my_strndup(new_log_ident_arg, ident_len, MYF(MY_WME)); new_log_ident= my_strndup(new_log_ident_arg, ident_len, MYF(MY_WME));
@ -4152,7 +4153,7 @@ Slave_log_event::Slave_log_event(THD* thd_arg,
memcpy(master_log, rli->group_master_log_name, master_log_len + 1); memcpy(master_log, rli->group_master_log_name, master_log_len + 1);
master_port = mi->port; master_port = mi->port;
master_pos = rli->group_master_log_pos; master_pos = rli->group_master_log_pos;
DBUG_PRINT("info", ("master_log: %s pos: %d", master_log, DBUG_PRINT("info", ("master_log: %s pos: %lu", master_log,
(ulong) master_pos)); (ulong) master_pos));
} }
else else

View File

@ -3526,7 +3526,7 @@ int main(int argc, char **argv)
if (stack_size && stack_size < thread_stack) if (stack_size && stack_size < thread_stack)
{ {
if (global_system_variables.log_warnings) if (global_system_variables.log_warnings)
sql_print_warning("Asked for %ld thread stack, but got %ld", sql_print_warning("Asked for %lu thread stack, but got %ld",
thread_stack, (long) stack_size); thread_stack, (long) stack_size);
#if defined(__ia64__) || defined(__ia64) #if defined(__ia64__) || defined(__ia64)
thread_stack= stack_size*2; thread_stack= stack_size*2;
@ -4072,7 +4072,7 @@ static void create_new_thread(THD *thd)
int error; int error;
thread_created++; thread_created++;
threads.append(thd); threads.append(thd);
DBUG_PRINT("info",(("creating thread %d"), thd->thread_id)); DBUG_PRINT("info",(("creating thread %lu"), thd->thread_id));
thd->connect_time = time(NULL); thd->connect_time = time(NULL);
if ((error=pthread_create(&thd->real_id,&connection_attrib, if ((error=pthread_create(&thd->real_id,&connection_attrib,
handle_one_connection, handle_one_connection,

View File

@ -809,7 +809,7 @@ my_real_read(NET *net, ulong *complen)
{ {
my_bool interrupted = vio_should_retry(net->vio); my_bool interrupted = vio_should_retry(net->vio);
DBUG_PRINT("info",("vio_read returned %d, errno: %d", DBUG_PRINT("info",("vio_read returned %ld, errno: %d",
length, vio_errno(net->vio))); length, vio_errno(net->vio)));
#if !defined(__WIN__) || defined(MYSQL_SERVER) #if !defined(__WIN__) || defined(MYSQL_SERVER)
/* /*

View File

@ -1003,7 +1003,7 @@ QUICK_RANGE_SELECT::~QUICK_RANGE_SELECT()
range_end(); range_end();
if (free_file) if (free_file)
{ {
DBUG_PRINT("info", ("Freeing separate handler %p (free=%d)", file, DBUG_PRINT("info", ("Freeing separate handler 0x%lx (free: %d)", (long) file,
free_file)); free_file));
file->ha_external_lock(current_thd, F_UNLCK); file->ha_external_lock(current_thd, F_UNLCK);
file->close(); file->close();
@ -2011,7 +2011,7 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use,
double scan_time; double scan_time;
DBUG_ENTER("SQL_SELECT::test_quick_select"); DBUG_ENTER("SQL_SELECT::test_quick_select");
DBUG_PRINT("enter",("keys_to_use: %lu prev_tables: %lu const_tables: %lu", DBUG_PRINT("enter",("keys_to_use: %lu prev_tables: %lu const_tables: %lu",
keys_to_use.to_ulonglong(), (ulong) prev_tables, (ulong) keys_to_use.to_ulonglong(), (ulong) prev_tables,
(ulong) const_tables)); (ulong) const_tables));
DBUG_PRINT("info", ("records: %lu", (ulong) head->file->stats.records)); DBUG_PRINT("info", ("records: %lu", (ulong) head->file->stats.records));
delete quick; delete quick;
@ -3396,7 +3396,7 @@ double get_sweep_read_cost(const PARAM *param, ha_rows records)
n_blocks * (1.0 - pow(1.0 - 1.0/n_blocks, rows2double(records))); n_blocks * (1.0 - pow(1.0 - 1.0/n_blocks, rows2double(records)));
if (busy_blocks < 1.0) if (busy_blocks < 1.0)
busy_blocks= 1.0; busy_blocks= 1.0;
DBUG_PRINT("info",("sweep: nblocks=%g, busy_blocks=%g", n_blocks, DBUG_PRINT("info",("sweep: nblocks: %g, busy_blocks: %g", n_blocks,
busy_blocks)); busy_blocks));
/* /*
Disabled: Bail out if # of blocks to read is bigger than # of blocks in Disabled: Bail out if # of blocks to read is bigger than # of blocks in
@ -3420,7 +3420,7 @@ double get_sweep_read_cost(const PARAM *param, ha_rows records)
result= busy_blocks; result= busy_blocks;
} }
} }
DBUG_PRINT("info",("returning cost=%g", result)); DBUG_PRINT("return",("cost: %g", result));
DBUG_RETURN(result); DBUG_RETURN(result);
} }
@ -3514,7 +3514,7 @@ TABLE_READ_PLAN *get_best_disjunct_quick(PARAM *param, SEL_IMERGE *imerge,
ha_rows roru_total_records; ha_rows roru_total_records;
double roru_intersect_part= 1.0; double roru_intersect_part= 1.0;
DBUG_ENTER("get_best_disjunct_quick"); DBUG_ENTER("get_best_disjunct_quick");
DBUG_PRINT("info", ("Full table scan cost =%g", read_time)); DBUG_PRINT("info", ("Full table scan cost: %g", read_time));
if (!(range_scans= (TRP_RANGE**)alloc_root(param->mem_root, if (!(range_scans= (TRP_RANGE**)alloc_root(param->mem_root,
sizeof(TRP_RANGE*)* sizeof(TRP_RANGE*)*
@ -3558,7 +3558,7 @@ TABLE_READ_PLAN *get_best_disjunct_quick(PARAM *param, SEL_IMERGE *imerge,
non_cpk_scan_records += (*cur_child)->records; non_cpk_scan_records += (*cur_child)->records;
} }
DBUG_PRINT("info", ("index_merge scans cost=%g", imerge_cost)); DBUG_PRINT("info", ("index_merge scans cost %g", imerge_cost));
if (imerge_too_expensive || (imerge_cost > read_time) || if (imerge_too_expensive || (imerge_cost > read_time) ||
(non_cpk_scan_records+cpk_scan_records >= param->table->file->stats.records) && (non_cpk_scan_records+cpk_scan_records >= param->table->file->stats.records) &&
read_time != DBL_MAX) read_time != DBL_MAX)
@ -4172,7 +4172,7 @@ static bool ror_intersect_add(ROR_INTERSECT_INFO *info,
DBUG_PRINT("info", ("Current out_rows= %g", info->out_rows)); DBUG_PRINT("info", ("Current out_rows= %g", info->out_rows));
DBUG_PRINT("info", ("Adding scan on %s", DBUG_PRINT("info", ("Adding scan on %s",
info->param->table->key_info[ror_scan->keynr].name)); info->param->table->key_info[ror_scan->keynr].name));
DBUG_PRINT("info", ("is_cpk_scan=%d",is_cpk_scan)); DBUG_PRINT("info", ("is_cpk_scan: %d",is_cpk_scan));
selectivity_mult = ror_scan_selectivity(info, ror_scan); selectivity_mult = ror_scan_selectivity(info, ror_scan);
if (selectivity_mult == 1.0) if (selectivity_mult == 1.0)
@ -9700,8 +9700,8 @@ void cost_group_min_max(TABLE* table, KEY *index_info, uint used_key_parts,
*records= num_groups; *records= num_groups;
DBUG_PRINT("info", DBUG_PRINT("info",
("table rows=%u, keys/block=%u, keys/group=%u, result rows=%u, blocks=%u", ("table rows: %u keys/block: %u keys/group: %u result rows: %lu blocks: %u",
table_records, keys_per_block, keys_per_group, *records, table_records, keys_per_block, keys_per_group, (ulong) *records,
num_blocks)); num_blocks));
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }

View File

@ -2604,7 +2604,7 @@ static int process_io_rotate(MASTER_INFO *mi, Rotate_log_event *rev)
/* Safe copy as 'rev' has been "sanitized" in Rotate_log_event's ctor */ /* Safe copy as 'rev' has been "sanitized" in Rotate_log_event's ctor */
memcpy(mi->master_log_name, rev->new_log_ident, rev->ident_len+1); memcpy(mi->master_log_name, rev->new_log_ident, rev->ident_len+1);
mi->master_log_pos= rev->pos; mi->master_log_pos= rev->pos;
DBUG_PRINT("info", ("master_log_pos: '%s' %d", DBUG_PRINT("info", ("master_log_pos: '%s' %lu",
mi->master_log_name, (ulong) mi->master_log_pos)); mi->master_log_name, (ulong) mi->master_log_pos));
#ifndef DBUG_OFF #ifndef DBUG_OFF
/* /*
@ -2721,7 +2721,7 @@ static int queue_binlog_ver_1_event(MASTER_INFO *mi, const char *buf,
int error = process_io_create_file(mi,(Create_file_log_event*)ev); int error = process_io_create_file(mi,(Create_file_log_event*)ev);
delete ev; delete ev;
mi->master_log_pos += inc_pos; mi->master_log_pos += inc_pos;
DBUG_PRINT("info", ("master_log_pos: %d", (ulong) mi->master_log_pos)); DBUG_PRINT("info", ("master_log_pos: %lu", (ulong) mi->master_log_pos));
pthread_mutex_unlock(&mi->data_lock); pthread_mutex_unlock(&mi->data_lock);
my_free((char*)tmp_buf, MYF(0)); my_free((char*)tmp_buf, MYF(0));
DBUG_RETURN(error); DBUG_RETURN(error);
@ -2748,7 +2748,7 @@ static int queue_binlog_ver_1_event(MASTER_INFO *mi, const char *buf,
} }
delete ev; delete ev;
mi->master_log_pos+= inc_pos; mi->master_log_pos+= inc_pos;
DBUG_PRINT("info", ("master_log_pos: %d", (ulong) mi->master_log_pos)); DBUG_PRINT("info", ("master_log_pos: %lu", (ulong) mi->master_log_pos));
pthread_mutex_unlock(&mi->data_lock); pthread_mutex_unlock(&mi->data_lock);
DBUG_RETURN(0); DBUG_RETURN(0);
} }
@ -2804,7 +2804,7 @@ static int queue_binlog_ver_3_event(MASTER_INFO *mi, const char *buf,
delete ev; delete ev;
mi->master_log_pos+= inc_pos; mi->master_log_pos+= inc_pos;
err: err:
DBUG_PRINT("info", ("master_log_pos: %d", (ulong) mi->master_log_pos)); DBUG_PRINT("info", ("master_log_pos: %lu", (ulong) mi->master_log_pos));
pthread_mutex_unlock(&mi->data_lock); pthread_mutex_unlock(&mi->data_lock);
DBUG_RETURN(0); DBUG_RETURN(0);
} }
@ -2977,7 +2977,8 @@ int queue_event(MASTER_INFO* mi,const char* buf, ulong event_len)
rli->ign_master_log_pos_end= mi->master_log_pos; rli->ign_master_log_pos_end= mi->master_log_pos;
} }
rli->relay_log.signal_update(); // the slave SQL thread needs to re-check rli->relay_log.signal_update(); // the slave SQL thread needs to re-check
DBUG_PRINT("info", ("master_log_pos: %d, event originating from the same server, ignored", (ulong) mi->master_log_pos)); DBUG_PRINT("info", ("master_log_pos: %lu, event originating from the same server, ignored",
(ulong) mi->master_log_pos));
} }
else else
{ {
@ -2985,7 +2986,7 @@ int queue_event(MASTER_INFO* mi,const char* buf, ulong event_len)
if (likely(!(rli->relay_log.appendv(buf,event_len,0)))) if (likely(!(rli->relay_log.appendv(buf,event_len,0))))
{ {
mi->master_log_pos+= inc_pos; mi->master_log_pos+= inc_pos;
DBUG_PRINT("info", ("master_log_pos: %d", (ulong) mi->master_log_pos)); DBUG_PRINT("info", ("master_log_pos: %lu", (ulong) mi->master_log_pos));
rli->relay_log.harvest_bytes_written(&rli->log_space_total); rli->relay_log.harvest_bytes_written(&rli->log_space_total);
} }
else else

View File

@ -3871,7 +3871,7 @@ bool check_grant_column(THD *thd, GRANT_INFO *grant,
GRANT_COLUMN *grant_column; GRANT_COLUMN *grant_column;
ulong want_access= grant->want_privilege & ~grant->privilege; ulong want_access= grant->want_privilege & ~grant->privilege;
DBUG_ENTER("check_grant_column"); DBUG_ENTER("check_grant_column");
DBUG_PRINT("enter", ("table: %s want_access: %u", table_name, want_access)); DBUG_PRINT("enter", ("table: %s want_access: %lu", table_name, want_access));
if (!want_access) if (!want_access)
DBUG_RETURN(0); // Already checked DBUG_RETURN(0); // Already checked

View File

@ -523,7 +523,8 @@ void Query_cache_query::init_n_lock()
my_rwlock_init(&lock, NULL); my_rwlock_init(&lock, NULL);
lock_writing(); lock_writing();
DBUG_PRINT("qcache", ("inited & locked query for block 0x%lx", DBUG_PRINT("qcache", ("inited & locked query for block 0x%lx",
((byte*) this)-ALIGN_SIZE(sizeof(Query_cache_block)))); (long) (((byte*) this) -
ALIGN_SIZE(sizeof(Query_cache_block)))));
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
@ -532,7 +533,8 @@ void Query_cache_query::unlock_n_destroy()
{ {
DBUG_ENTER("Query_cache_query::unlock_n_destroy"); DBUG_ENTER("Query_cache_query::unlock_n_destroy");
DBUG_PRINT("qcache", ("destroyed & unlocked query for block 0x%lx", DBUG_PRINT("qcache", ("destroyed & unlocked query for block 0x%lx",
((byte*)this)-ALIGN_SIZE(sizeof(Query_cache_block)))); (long) (((byte*) this) -
ALIGN_SIZE(sizeof(Query_cache_block)))));
/* /*
The following call is not needed on system where one can destroy an The following call is not needed on system where one can destroy an
active semaphore active semaphore
@ -698,6 +700,7 @@ void query_cache_abort(NET *net)
void query_cache_end_of_result(THD *thd) void query_cache_end_of_result(THD *thd)
{ {
Query_cache_block *query_block;
DBUG_ENTER("query_cache_end_of_result"); DBUG_ENTER("query_cache_end_of_result");
/* See the comment on double-check locking usage above. */ /* See the comment on double-check locking usage above. */
@ -713,13 +716,9 @@ void query_cache_end_of_result(THD *thd)
if (unlikely(query_cache.query_cache_size == 0 || if (unlikely(query_cache.query_cache_size == 0 ||
query_cache.flush_in_progress)) query_cache.flush_in_progress))
{ goto end;
STRUCT_UNLOCK(&query_cache.structure_guard_mutex);
DBUG_VOID_RETURN;
}
Query_cache_block *query_block= ((Query_cache_block*) query_block= ((Query_cache_block*) thd->net.query_cache_query);
thd->net.query_cache_query);
if (query_block) if (query_block)
{ {
DUMP(&query_cache); DUMP(&query_cache);
@ -738,27 +737,21 @@ void query_cache_end_of_result(THD *thd)
header->query())); header->query()));
query_cache.wreck(__LINE__, ""); query_cache.wreck(__LINE__, "");
STRUCT_UNLOCK(&query_cache.structure_guard_mutex); BLOCK_UNLOCK_WR(query_block);
goto end;
DBUG_VOID_RETURN;
} }
#endif #endif
header->found_rows(current_thd->limit_found_rows); header->found_rows(current_thd->limit_found_rows);
header->result()->type= Query_cache_block::RESULT; header->result()->type= Query_cache_block::RESULT;
header->writer(0); header->writer(0);
thd->net.query_cache_query= 0; thd->net.query_cache_query= 0;
BLOCK_UNLOCK_WR(query_block);
DBUG_EXECUTE("check_querycache",query_cache.check_integrity(1);); DBUG_EXECUTE("check_querycache",query_cache.check_integrity(1););
STRUCT_UNLOCK(&query_cache.structure_guard_mutex);
BLOCK_UNLOCK_WR(query_block);
}
else
{
// Cache was flushed or resized and query was deleted => do nothing
STRUCT_UNLOCK(&query_cache.structure_guard_mutex);
} }
end:
STRUCT_UNLOCK(&query_cache.structure_guard_mutex);
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
@ -875,8 +868,8 @@ sql mode: 0x%lx, sort len: %lu, conncat len: %lu",
flags.character_set_client_num, flags.character_set_client_num,
flags.character_set_results_num, flags.character_set_results_num,
flags.collation_connection_num, flags.collation_connection_num,
flags.limit, (ulong) flags.limit,
(ulong)flags.time_zone, (ulong) flags.time_zone,
flags.sql_mode, flags.sql_mode,
flags.max_sort_length, flags.max_sort_length,
flags.group_concat_max_len)); flags.group_concat_max_len));
@ -1119,8 +1112,8 @@ sql mode: 0x%lx, sort len: %lu, conncat len: %lu",
flags.character_set_client_num, flags.character_set_client_num,
flags.character_set_results_num, flags.character_set_results_num,
flags.collation_connection_num, flags.collation_connection_num,
flags.limit, (ulong) flags.limit,
(ulong)flags.time_zone, (ulong) flags.time_zone,
flags.sql_mode, flags.sql_mode,
flags.max_sort_length, flags.max_sort_length,
flags.group_concat_max_len)); flags.group_concat_max_len));
@ -1257,7 +1250,7 @@ sql mode: 0x%lx, sort len: %lu, conncat len: %lu",
#ifndef EMBEDDED_LIBRARY #ifndef EMBEDDED_LIBRARY
do do
{ {
DBUG_PRINT("qcache", ("Results (len %lu, used %lu, headers %lu)", DBUG_PRINT("qcache", ("Results (len: %lu used: %lu headers: %u)",
result_block->length, result_block->used, result_block->length, result_block->used,
result_block->headers_len()+ result_block->headers_len()+
ALIGN_SIZE(sizeof(Query_cache_result)))); ALIGN_SIZE(sizeof(Query_cache_result))));
@ -2034,7 +2027,7 @@ Query_cache::append_result_data(Query_cache_block **current_block,
{ {
DBUG_ENTER("Query_cache::append_result_data"); DBUG_ENTER("Query_cache::append_result_data");
DBUG_PRINT("qcache", ("append %lu bytes to 0x%lx query", DBUG_PRINT("qcache", ("append %lu bytes to 0x%lx query",
data_len, query_block)); data_len, (long) query_block));
if (query_block->query()->add(data_len) > query_cache_limit) if (query_block->query()->add(data_len) > query_cache_limit)
{ {
@ -3043,9 +3036,9 @@ Query_cache::is_cacheable(THD *thd, uint32 query_len, char *query, LEX *lex,
OPTION_TO_QUERY_CACHE))) && OPTION_TO_QUERY_CACHE))) &&
lex->safe_to_cache_query) lex->safe_to_cache_query)
{ {
DBUG_PRINT("qcache", ("options %lx %lx, type %u", DBUG_PRINT("qcache", ("options: %lx %lx type: %u",
OPTION_TO_QUERY_CACHE, OPTION_TO_QUERY_CACHE,
lex->select_lex.options, (long) lex->select_lex.options,
(int) thd->variables.query_cache_type)); (int) thd->variables.query_cache_type));
if (!(table_count= process_and_count_tables(tables_used, tables_type))) if (!(table_count= process_and_count_tables(tables_used, tables_type)))
@ -3062,10 +3055,10 @@ Query_cache::is_cacheable(THD *thd, uint32 query_len, char *query, LEX *lex,
} }
DBUG_PRINT("qcache", DBUG_PRINT("qcache",
("not interesting query: %d or not cacheable, options %lx %lx, type %u", ("not interesting query: %d or not cacheable, options %lx %lx type: %u",
(int) lex->sql_command, (int) lex->sql_command,
OPTION_TO_QUERY_CACHE, OPTION_TO_QUERY_CACHE,
lex->select_lex.options, (long) lex->select_lex.options,
(int) thd->variables.query_cache_type)); (int) thd->variables.query_cache_type));
DBUG_RETURN(0); DBUG_RETURN(0);
} }
@ -3656,7 +3649,8 @@ void Query_cache::queries_dump()
DBUG_PRINT("qcache", ("F:%u C:%u L:%lu T:'%s' (%u) '%s' '%s'", DBUG_PRINT("qcache", ("F:%u C:%u L:%lu T:'%s' (%u) '%s' '%s'",
flags.client_long_flag, flags.client_long_flag,
flags.character_set_client_num, flags.character_set_client_num,
(ulong)flags.limit, flags.time_zone->get_name(), (ulong)flags.limit,
flags.time_zone->get_name()->ptr(),
len, str, strend(str)+1)); len, str, strend(str)+1));
DBUG_PRINT("qcache", ("-b- 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx", (ulong) block, DBUG_PRINT("qcache", ("-b- 0x%lx 0x%lx 0x%lx 0x%lx 0x%lx", (ulong) block,
(ulong) block->next, (ulong) block->prev, (ulong) block->next, (ulong) block->prev,
@ -3876,9 +3870,8 @@ my_bool Query_cache::check_integrity(bool locked)
break; break;
} }
default: default:
DBUG_PRINT("error", DBUG_PRINT("error", ("block 0x%lx have incorrect type %u",
("block 0x%lx have incorrect type %u", (long) block, block->type));
block, block->type));
result = 1; result = 1;
} }
@ -3976,8 +3969,8 @@ my_bool Query_cache::check_integrity(bool locked)
} while (block != bins[i].free_blocks); } while (block != bins[i].free_blocks);
if (count != bins[i].number) if (count != bins[i].number)
{ {
DBUG_PRINT("error", ("bin[%d].number is %d, but bin have %d blocks", DBUG_PRINT("error", ("bins[%d].number = %d, but bin have %d blocks",
bins[i].number, count)); i, bins[i].number, count));
result = 1; result = 1;
} }
} }

View File

@ -799,7 +799,7 @@ void THD::add_changed_table(const char *key, long key_length)
{ {
list_include(prev_changed, curr, changed_table_dup(key, key_length)); list_include(prev_changed, curr, changed_table_dup(key, key_length));
DBUG_PRINT("info", DBUG_PRINT("info",
("key_length %u %u", key_length, (*prev_changed)->key_length)); ("key_length %ld %u", key_length, (*prev_changed)->key_length));
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
else if (cmp == 0) else if (cmp == 0)
@ -809,7 +809,7 @@ void THD::add_changed_table(const char *key, long key_length)
{ {
list_include(prev_changed, curr, changed_table_dup(key, key_length)); list_include(prev_changed, curr, changed_table_dup(key, key_length));
DBUG_PRINT("info", DBUG_PRINT("info",
("key_length %u %u", key_length, ("key_length %ld %u", key_length,
(*prev_changed)->key_length)); (*prev_changed)->key_length));
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
@ -821,7 +821,7 @@ void THD::add_changed_table(const char *key, long key_length)
} }
} }
*prev_changed = changed_table_dup(key, key_length); *prev_changed = changed_table_dup(key, key_length);
DBUG_PRINT("info", ("key_length %u %u", key_length, DBUG_PRINT("info", ("key_length %ld %u", key_length,
(*prev_changed)->key_length)); (*prev_changed)->key_length));
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }

View File

@ -2065,7 +2065,7 @@ public:
inline bool unique_add(void *ptr) inline bool unique_add(void *ptr)
{ {
DBUG_ENTER("unique_add"); DBUG_ENTER("unique_add");
DBUG_PRINT("info", ("tree %u - %u", tree.elements_in_tree, max_elements)); DBUG_PRINT("info", ("tree %u - %lu", tree.elements_in_tree, max_elements));
if (tree.elements_in_tree > max_elements && flush()) if (tree.elements_in_tree > max_elements && flush())
DBUG_RETURN(1); DBUG_RETURN(1);
DBUG_RETURN(!tree_insert(&tree, ptr, 0, tree.custom_arg)); DBUG_RETURN(!tree_insert(&tree, ptr, 0, tree.custom_arg));

View File

@ -354,7 +354,7 @@ cleanup:
{ {
thd->row_count_func= deleted; thd->row_count_func= deleted;
send_ok(thd,deleted); send_ok(thd,deleted);
DBUG_PRINT("info",("%d records deleted",deleted)); DBUG_PRINT("info",("%ld records deleted",(long) deleted));
} }
DBUG_RETURN(error >= 0 || thd->net.report_error); DBUG_RETURN(error >= 0 || thd->net.report_error);
} }

View File

@ -394,9 +394,9 @@ int check_user(THD *thd, enum enum_server_command command,
NO_ACCESS)) // authentication is OK NO_ACCESS)) // authentication is OK
{ {
DBUG_PRINT("info", DBUG_PRINT("info",
("Capabilities: %lx packet_length: %ld Host: '%s' " ("Capabilities: %lu packet_length: %ld Host: '%s' "
"Login user: '%s' Priv_user: '%s' Using password: %s " "Login user: '%s' Priv_user: '%s' Using password: %s "
"Access: %u db: '%s'", "Access: %lu db: '%s'",
thd->client_capabilities, thd->client_capabilities,
thd->max_client_packet_length, thd->max_client_packet_length,
thd->main_security_ctx.host_or_ip, thd->main_security_ctx.host_or_ip,
@ -1002,7 +1002,7 @@ static int check_connection(THD *thd)
if (thd->client_capabilities & CLIENT_IGNORE_SPACE) if (thd->client_capabilities & CLIENT_IGNORE_SPACE)
thd->variables.sql_mode|= MODE_IGNORE_SPACE; thd->variables.sql_mode|= MODE_IGNORE_SPACE;
#ifdef HAVE_OPENSSL #ifdef HAVE_OPENSSL
DBUG_PRINT("info", ("client capabilities: %d", thd->client_capabilities)); DBUG_PRINT("info", ("client capabilities: %lu", thd->client_capabilities));
if (thd->client_capabilities & CLIENT_SSL) if (thd->client_capabilities & CLIENT_SSL)
{ {
/* Do the SSL layering. */ /* Do the SSL layering. */
@ -1158,7 +1158,7 @@ pthread_handler_t handle_one_connection(void *arg)
of handle_one_connection, which is thd. We need to know the of handle_one_connection, which is thd. We need to know the
start of the stack so that we could check for stack overruns. start of the stack so that we could check for stack overruns.
*/ */
DBUG_PRINT("info", ("handle_one_connection called by thread %d\n", DBUG_PRINT("info", ("handle_one_connection called by thread %lu\n",
thd->thread_id)); thd->thread_id));
/* now that we've called my_thread_init(), it is safe to call DBUG_* */ /* now that we've called my_thread_init(), it is safe to call DBUG_* */
@ -1826,7 +1826,9 @@ bool dispatch_command(enum enum_server_command command, THD *thd,
if (alloc_query(thd, packet, packet_length)) if (alloc_query(thd, packet, packet_length))
break; // fatal error is set break; // fatal error is set
char *packet_end= thd->query + thd->query_length; char *packet_end= thd->query + thd->query_length;
general_log_print(thd, command, "%.*b", thd->query_length, thd->query); /* 'b' stands for 'buffer' parameter', special for 'my_snprintf' */
const char *format= "%.*b";
general_log.write(thd, command, format, thd->query_length, thd->query);
DBUG_PRINT("query",("%-.4096s",thd->query)); DBUG_PRINT("query",("%-.4096s",thd->query));
if (!(specialflag & SPECIAL_NO_PRIOR)) if (!(specialflag & SPECIAL_NO_PRIOR))

View File

@ -1665,7 +1665,7 @@ static bool check_prepared_statement(Prepared_statement *stmt,
enum enum_sql_command sql_command= lex->sql_command; enum enum_sql_command sql_command= lex->sql_command;
int res= 0; int res= 0;
DBUG_ENTER("check_prepared_statement"); DBUG_ENTER("check_prepared_statement");
DBUG_PRINT("enter",("command: %d, param_count: %ld", DBUG_PRINT("enter",("command: %d, param_count: %u",
sql_command, stmt->param_count)); sql_command, stmt->param_count));
lex->first_lists_tables_same(); lex->first_lists_tables_same();
@ -1916,9 +1916,12 @@ void mysql_stmt_prepare(THD *thd, const char *packet, uint packet_length)
thd->stmt_map.erase(stmt); thd->stmt_map.erase(stmt);
} }
else else
general_log_print(thd, COM_STMT_PREPARE, "[%lu] %.*b", stmt->id, {
const char *format= "[%lu] %.*b";
general_log.write(thd, COM_STMT_PREPARE, format, stmt->id,
stmt->query_length, stmt->query); stmt->query_length, stmt->query);
}
/* check_prepared_statemnt sends the metadata packet in case of success */ /* check_prepared_statemnt sends the metadata packet in case of success */
DBUG_VOID_RETURN; DBUG_VOID_RETURN;
} }
@ -2300,7 +2303,9 @@ void mysql_stmt_execute(THD *thd, char *packet_arg, uint packet_length)
if (!(specialflag & SPECIAL_NO_PRIOR)) if (!(specialflag & SPECIAL_NO_PRIOR))
my_pthread_setprio(pthread_self(), WAIT_PRIOR); my_pthread_setprio(pthread_self(), WAIT_PRIOR);
if (error == 0) if (error == 0)
general_log_print(thd, COM_STMT_EXECUTE, "[%lu] %.*b", stmt->id, {
const char *format= "[%lu] %.*b";
general_log.write(thd, COM_STMT_EXECUTE, format, stmt->id,
thd->query_length, thd->query); thd->query_length, thd->query);
DBUG_VOID_RETURN; DBUG_VOID_RETURN;

View File

@ -1111,7 +1111,7 @@ bool change_master(THD* thd, MASTER_INFO* mi)
{ {
mi->master_log_pos= lex_mi->pos; mi->master_log_pos= lex_mi->pos;
} }
DBUG_PRINT("info", ("master_log_pos: %d", (ulong) mi->master_log_pos)); DBUG_PRINT("info", ("master_log_pos: %lu", (ulong) mi->master_log_pos));
if (lex_mi->host) if (lex_mi->host)
strmake(mi->host, lex_mi->host, sizeof(mi->host)-1); strmake(mi->host, lex_mi->host, sizeof(mi->host)-1);
@ -1228,7 +1228,7 @@ bool change_master(THD* thd, MASTER_INFO* mi)
} }
} }
mi->rli.group_master_log_pos = mi->master_log_pos; mi->rli.group_master_log_pos = mi->master_log_pos;
DBUG_PRINT("info", ("master_log_pos: %d", (ulong) mi->master_log_pos)); DBUG_PRINT("info", ("master_log_pos: %lu", (ulong) mi->master_log_pos));
/* /*
Coordinates in rli were spoilt by the 'if (need_relay_log_purge)' block, Coordinates in rli were spoilt by the 'if (need_relay_log_purge)' block,

View File

@ -10180,7 +10180,7 @@ do_select(JOIN *join,List<Item> *fields,TABLE *table,Procedure *procedure)
if (join->result->send_eof()) if (join->result->send_eof())
rc= 1; // Don't send error rc= 1; // Don't send error
} }
DBUG_PRINT("info",("%ld records output",join->send_records)); DBUG_PRINT("info",("%ld records output", (long) join->send_records));
} }
else else
rc= -1; rc= -1;

View File

@ -691,7 +691,7 @@ int mysql_update(THD *thd,
thd->row_count_func= thd->row_count_func=
(thd->client_capabilities & CLIENT_FOUND_ROWS) ? found : updated; (thd->client_capabilities & CLIENT_FOUND_ROWS) ? found : updated;
send_ok(thd, (ulong) thd->row_count_func, id, buff); send_ok(thd, (ulong) thd->row_count_func, id, buff);
DBUG_PRINT("info",("%d records updated",updated)); DBUG_PRINT("info",("%ld records updated", (long) updated));
} }
thd->count_cuted_fields= CHECK_FIELD_IGNORE; /* calc cuted fields */ thd->count_cuted_fields= CHECK_FIELD_IGNORE; /* calc cuted fields */
thd->abort_on_warning= 0; thd->abort_on_warning= 0;
@ -788,7 +788,7 @@ static table_map get_table_map(List<Item> *items)
while ((item= (Item_field *) item_it++)) while ((item= (Item_field *) item_it++))
map|= item->used_tables(); map|= item->used_tables();
DBUG_PRINT("info",("table_map: 0x%08x", map)); DBUG_PRINT("info", ("table_map: 0x%08lx", (long) map));
return map; return map;
} }

Some files were not shown because too many files have changed in this diff Show More