mirror of
https://github.com/MariaDB/server.git
synced 2025-09-02 09:41:40 +03:00
Merge dl145s.mysql.com:/data0/bk/team_tree_merge/mysql-5.0-opt
into dl145s.mysql.com:/data0/bk/team_tree_merge/MERGE2/mysql-5.0-opt
This commit is contained in:
@@ -1322,3 +1322,4 @@ win/vs71cache.txt
|
||||
win/vs8cache.txt
|
||||
zlib/*.ds?
|
||||
zlib/*.vcproj
|
||||
mysql-test/r/*.warnings
|
||||
|
@@ -56,9 +56,9 @@ global_warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wch
|
||||
#debug_extra_warnings="-Wuninitialized"
|
||||
c_warnings="$global_warnings -Wunused"
|
||||
cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor"
|
||||
base_max_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine $SSL_LIBRARY"
|
||||
base_max_no_ndb_configs="--with-innodb --with-berkeley-db --without-ndbcluster --with-archive-storage-engine --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine $SSL_LIBRARY"
|
||||
max_leave_isam_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-federated-storage-engine --with-blackhole-storage-engine --with-csv-storage-engine $SSL_LIBRARY --with-embedded-server --with-big-tables"
|
||||
base_max_configs="--with-innodb --with-ndbcluster --with-archive-storage-engine --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine $SSL_LIBRARY"
|
||||
base_max_no_ndb_configs="--with-innodb --without-ndbcluster --with-archive-storage-engine --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine --with-csv-storage-engine $SSL_LIBRARY"
|
||||
max_leave_isam_configs="--with-innodb --with-ndbcluster --with-archive-storage-engine --with-federated-storage-engine --with-blackhole-storage-engine --with-csv-storage-engine $SSL_LIBRARY --with-embedded-server --with-big-tables"
|
||||
max_configs="$base_max_configs --with-embedded-server"
|
||||
max_no_ndb_configs="$base_max_no_ndb_configs --with-embedded-server"
|
||||
|
||||
|
@@ -26,7 +26,7 @@ all-local: $(TXT_FILES)
|
||||
# make sure that "make install" installs the info page, too
|
||||
# automake only seems to take care of this automatically,
|
||||
# if we're building the info page from texi directly.
|
||||
install-data-hook: mysql.info
|
||||
install-data-hook: $(srcdir)/mysql.info
|
||||
$(mkinstalldirs) $(DESTDIR)$(infodir)
|
||||
$(INSTALL_DATA) $(srcdir)/mysql.info $(DESTDIR)$(infodir)
|
||||
|
||||
@@ -44,23 +44,23 @@ CLEAN_FILES: $(TXT_FILES)
|
||||
|
||||
GT = $(srcdir)/Support/generate-text-files.pl
|
||||
|
||||
../INSTALL-SOURCE: mysql.info $(GT)
|
||||
perl -w $(GT) mysql.info "installing-source" "windows-source-build" > $@
|
||||
../INSTALL-SOURCE: $(srcdir)/mysql.info $(GT)
|
||||
perl -w $(GT) $(srcdir)/mysql.info "installing-source" "windows-source-build" > $@
|
||||
|
||||
../INSTALL-WIN-SOURCE: mysql.info $(GT)
|
||||
perl -w $(GT) mysql.info "windows-source-build" "post-installation" > $@
|
||||
../INSTALL-WIN-SOURCE: $(srcdir)/mysql.info $(GT)
|
||||
perl -w $(GT) $(srcdir)/mysql.info "windows-source-build" "post-installation" > $@
|
||||
|
||||
# We put the description for the binary installation here so that
|
||||
# people who download source wont have to see it. It is moved up to
|
||||
# the toplevel by the script that makes the binary tar files.
|
||||
INSTALL-BINARY: mysql.info $(GT)
|
||||
perl -w $(GT) mysql.info "installing-binary" "installing-source" > $@
|
||||
INSTALL-BINARY: $(srcdir)/mysql.info $(GT)
|
||||
perl -w $(GT) $(srcdir)/mysql.info "installing-binary" "installing-source" > $@
|
||||
|
||||
../EXCEPTIONS-CLIENT: mysql.info $(GT)
|
||||
perl -w $(GT) mysql.info "mysql-floss-license-exception" "function-index" > $@
|
||||
../EXCEPTIONS-CLIENT: $(srcdir)/mysql.info $(GT)
|
||||
perl -w $(GT) $(srcdir)/mysql.info "mysql-floss-license-exception" "function-index" > $@
|
||||
|
||||
../support-files/MacOSX/ReadMe.txt: mysql.info $(GT)
|
||||
perl -w $(GT) mysql.info "mac-os-x-installation" "netware-installation" > $@
|
||||
../support-files/MacOSX/ReadMe.txt: $(srcdir)/mysql.info $(GT)
|
||||
perl -w $(GT) $(srcdir)/mysql.info "mac-os-x-installation" "netware-installation" > $@
|
||||
|
||||
# Don't update the files from bitkeeper
|
||||
%::SCCS/s.%
|
||||
|
@@ -51,5 +51,6 @@ enum options_client
|
||||
#endif
|
||||
OPT_TRIGGERS,
|
||||
OPT_IGNORE_TABLE,OPT_INSERT_IGNORE,OPT_SHOW_WARNINGS,OPT_DROP_DATABASE,
|
||||
OPT_TZ_UTC, OPT_AUTO_CLOSE, OPT_SSL_VERIFY_SERVER_CERT
|
||||
OPT_TZ_UTC, OPT_AUTO_CLOSE, OPT_SSL_VERIFY_SERVER_CERT,
|
||||
OPT_DEBUG_INFO
|
||||
};
|
||||
|
@@ -373,22 +373,24 @@ static int comp_names(struct fileinfo *a, struct fileinfo *b)
|
||||
}
|
||||
|
||||
|
||||
static int
|
||||
find_file(const char *name, const char *root, uint flags, char *result, size_t len, ...)
|
||||
static int find_file(const char *name, const char *root,
|
||||
uint flags, char *result, size_t len, ...)
|
||||
{
|
||||
int ret;
|
||||
int ret= 1;
|
||||
va_list va;
|
||||
FILEINFO key= { (char*)name, NULL };
|
||||
const char *subdir;
|
||||
char *cp;
|
||||
|
||||
FILEINFO key;
|
||||
|
||||
/* Init key with name of the file to look for */
|
||||
key.name= (char*)name;
|
||||
|
||||
DBUG_ASSERT(root != NULL);
|
||||
|
||||
cp= strmake(result, root, len);
|
||||
if (cp[-1] != FN_LIBCHAR)
|
||||
*cp++= FN_LIBCHAR;
|
||||
|
||||
ret= 1;
|
||||
va_start(va, len);
|
||||
subdir= (!(flags & MY_SEARCH_SELF)) ? va_arg(va, char *) : "";
|
||||
while (subdir)
|
||||
|
@@ -1088,7 +1088,7 @@ could be out of memory");
|
||||
}
|
||||
if (len < 8 && net->read_pos[0] == 254)
|
||||
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]));
|
||||
if (!(ev= Log_event::read_log_event((const char*) net->read_pos + 1 ,
|
||||
len - 1, &error_msg,
|
||||
|
@@ -30,14 +30,14 @@
|
||||
** master/autocommit code by Brian Aker <brian@tangent.org>
|
||||
** SSL by
|
||||
** Andrei Errapart <andreie@no.spam.ee>
|
||||
** Tõnu Samuel <tonu@please.do.not.remove.this.spam.ee>
|
||||
** Tõnu Samuel <tonu@please.do.not.remove.this.spam.ee>
|
||||
** XML by Gary Huntress <ghuntress@mediaone.net> 10/10/01, cleaned up
|
||||
** and adapted to mysqldump 05/11/01 by Jani Tolonen
|
||||
** Added --single-transaction option 06/06/2002 by Peter Zaitsev
|
||||
** 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_sys.h>
|
||||
@@ -99,7 +99,7 @@ static my_bool verbose= 0, opt_no_create_info= 0, opt_no_data= 0,
|
||||
opt_dump_triggers= 0, opt_routines=0, opt_tz_utc=1;
|
||||
static ulong opt_max_allowed_packet, opt_net_buffer_length;
|
||||
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 char *opt_password=0,*current_user=0,
|
||||
*current_host=0,*path=0,*fields_terminated=0,
|
||||
@@ -107,6 +107,7 @@ static char *opt_password=0,*current_user=0,
|
||||
*where=0, *order_by=0,
|
||||
*opt_compatible_mode_str= 0,
|
||||
*err_ptr= 0;
|
||||
static char **defaults_argv= 0;
|
||||
static char compatible_mode_normal_str[255];
|
||||
static ulong opt_compatible_mode= 0;
|
||||
#define MYSQL_OPT_MASTER_DATA_EFFECTIVE_SQL 1
|
||||
@@ -116,7 +117,7 @@ static my_string opt_mysql_unix_port=0;
|
||||
static int first_error=0;
|
||||
static DYNAMIC_STRING extended_row;
|
||||
#include <sslopt-vars.h>
|
||||
FILE *md_result_file;
|
||||
FILE *md_result_file= 0;
|
||||
#ifdef HAVE_SMEM
|
||||
static char *shared_memory_base_name=0;
|
||||
#endif
|
||||
@@ -215,6 +216,8 @@ static struct my_option my_long_options[] =
|
||||
{"debug", '#', "Output debug log", (gptr*) &default_dbug_option,
|
||||
(gptr*) &default_dbug_option, 0, GET_STR, OPT_ARG, 0, 0, 0, 0, 0, 0},
|
||||
#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,
|
||||
"Set the default character set.", (gptr*) &default_charset,
|
||||
(gptr*) &default_charset, 0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0},
|
||||
@@ -628,14 +631,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
|
||||
get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
char *argument)
|
||||
@@ -678,6 +673,7 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
break;
|
||||
case '#':
|
||||
DBUG_PUSH(argument ? argument : default_dbug_option);
|
||||
info_flag= 1;
|
||||
break;
|
||||
#include <sslopt-case.h>
|
||||
case 'V': print_version(); exit(0);
|
||||
@@ -718,9 +714,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
|
||||
fprintf(stderr, "Illegal use of option --ignore-table=<database>.<table>\n");
|
||||
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))))
|
||||
exit(EX_EOM);
|
||||
break;
|
||||
@@ -796,9 +789,21 @@ static int get_options(int *argc, char ***argv)
|
||||
|
||||
md_result_file= stdout;
|
||||
load_defaults("my",load_default_groups,argc,argv);
|
||||
defaults_argv= *argv;
|
||||
|
||||
if ((ho_error=handle_options(argc, argv, my_long_options, get_one_option)))
|
||||
exit(ho_error);
|
||||
if (hash_init(&ignore_table, charset_info, 16, 0, 0,
|
||||
(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_net_buffer_length= opt_net_buffer_length;
|
||||
@@ -810,7 +815,7 @@ static int get_options(int *argc, char ***argv)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"%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 */
|
||||
@@ -820,7 +825,7 @@ static int get_options(int *argc, char ***argv)
|
||||
{
|
||||
fprintf(stderr, "%s: You can't use --single-transaction and "
|
||||
"--lock-all-tables at the same time.\n", my_progname);
|
||||
return(1);
|
||||
return(EX_USAGE);
|
||||
}
|
||||
if (opt_master_data)
|
||||
opt_lock_all_tables= !opt_single_transaction;
|
||||
@@ -829,14 +834,14 @@ static int get_options(int *argc, char ***argv)
|
||||
if (enclosed && opt_enclosed)
|
||||
{
|
||||
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)
|
||||
{
|
||||
fprintf(stderr,
|
||||
"%s: --databases or --all-databases can't be used with --tab.\n",
|
||||
my_progname);
|
||||
return(1);
|
||||
return(EX_USAGE);
|
||||
}
|
||||
if (strcmp(default_charset, charset_info->csname) &&
|
||||
!(charset_info= get_charset_by_csname(default_charset,
|
||||
@@ -845,7 +850,7 @@ static int get_options(int *argc, char ***argv)
|
||||
if ((*argc < 1 && !opt_alldbs) || (*argc > 0 && opt_alldbs))
|
||||
{
|
||||
short_usage();
|
||||
return 1;
|
||||
return EX_USAGE;
|
||||
}
|
||||
if (tty_password)
|
||||
opt_password=get_tty_password(NullS);
|
||||
@@ -920,6 +925,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)
|
||||
{
|
||||
if (!first_error)
|
||||
@@ -928,18 +950,19 @@ static void safe_exit(int error)
|
||||
return;
|
||||
if (mysql)
|
||||
mysql_close(mysql);
|
||||
free_resources();
|
||||
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];
|
||||
DBUG_ENTER("dbConnect");
|
||||
DBUG_ENTER("connect_to_db");
|
||||
|
||||
verbose_msg("-- Connecting to %s...\n", host ? host : "localhost");
|
||||
mysql_init(&mysql_connection);
|
||||
@@ -960,11 +983,11 @@ static int dbConnect(char *host, char *user,char *passwd)
|
||||
#endif
|
||||
mysql_options(&mysql_connection, MYSQL_SET_CHARSET_NAME, default_charset);
|
||||
if (!(mysql= mysql_real_connect(&mysql_connection,host,user,passwd,
|
||||
NULL,opt_mysql_port,opt_mysql_unix_port,
|
||||
0)))
|
||||
NULL,opt_mysql_port,opt_mysql_unix_port,
|
||||
0)))
|
||||
{
|
||||
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).
|
||||
@@ -981,7 +1004,7 @@ static int dbConnect(char *host, char *user,char *passwd)
|
||||
if (mysql_query_with_error_report(mysql, 0, buff))
|
||||
{
|
||||
safe_exit(EX_MYSQLERR);
|
||||
return 1;
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
/*
|
||||
set time_zone to UTC to allow dumping date types between servers with
|
||||
@@ -993,11 +1016,11 @@ static int dbConnect(char *host, char *user,char *passwd)
|
||||
if (mysql_query_with_error_report(mysql, 0, buff))
|
||||
{
|
||||
safe_exit(EX_MYSQLERR);
|
||||
return 1;
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
} /* dbConnect */
|
||||
DBUG_RETURN(0);
|
||||
} /* connect_to_db */
|
||||
|
||||
|
||||
/*
|
||||
@@ -1519,7 +1542,11 @@ static uint get_table_structure(char *table, char *db, char *table_type,
|
||||
{
|
||||
complete_insert= opt_complete_insert;
|
||||
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
|
||||
dynstr_set(&insert_pat, "");
|
||||
}
|
||||
@@ -1988,7 +2015,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 name_buff[NAME_LEN*4+3], table_buff[NAME_LEN*2+3];
|
||||
@@ -2176,7 +2203,7 @@ static void dump_table(char *table, char *db)
|
||||
The "table" could be a view. If so, we don't do anything here.
|
||||
*/
|
||||
if (strcmp (table_type, "VIEW") == 0)
|
||||
return;
|
||||
DBUG_VOID_RETURN;
|
||||
|
||||
/* Check --no-data flag */
|
||||
if (opt_no_data)
|
||||
@@ -2693,6 +2720,8 @@ static int dump_databases(char **db_names)
|
||||
{
|
||||
int result=0;
|
||||
char **db;
|
||||
DBUG_ENTER("dump_databases");
|
||||
|
||||
for (db= db_names ; *db ; db++)
|
||||
{
|
||||
if (dump_all_tables_in_db(*db))
|
||||
@@ -2706,7 +2735,7 @@ static int dump_databases(char **db_names)
|
||||
result=1;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
DBUG_RETURN(result);
|
||||
} /* dump_databases */
|
||||
|
||||
|
||||
@@ -2721,7 +2750,7 @@ RETURN VALUES
|
||||
0 Success.
|
||||
1 Failure.
|
||||
*/
|
||||
int init_dumping_views(char *qdatabase)
|
||||
int init_dumping_views(char *qdatabase __attribute__((unused)))
|
||||
{
|
||||
return 0;
|
||||
} /* init_dumping_views */
|
||||
@@ -2818,12 +2847,11 @@ static int init_dumping(char *database, int init_func(char*))
|
||||
} /* init_dumping */
|
||||
|
||||
|
||||
/* Return 1 if we should copy the table */
|
||||
|
||||
my_bool include_table(byte* hash_key, uint len)
|
||||
{
|
||||
if (hash_search(&ignore_table, (byte*) hash_key, len))
|
||||
return FALSE;
|
||||
|
||||
return TRUE;
|
||||
return !hash_search(&ignore_table, (byte*) hash_key, len);
|
||||
}
|
||||
|
||||
|
||||
@@ -2832,16 +2860,16 @@ static int dump_all_tables_in_db(char *database)
|
||||
char *table;
|
||||
uint numrows;
|
||||
char table_buff[NAME_LEN*2+3];
|
||||
|
||||
char hash_key[2*NAME_LEN+2]; /* "db.tablename" */
|
||||
char *afterdot;
|
||||
int using_mysql_db= my_strcasecmp(&my_charset_latin1, database, "mysql");
|
||||
DBUG_ENTER("dump_all_tables_in_db");
|
||||
|
||||
afterdot= strmov(hash_key, database);
|
||||
*afterdot++= '.';
|
||||
|
||||
if (init_dumping(database, init_dumping_tables))
|
||||
return 1;
|
||||
DBUG_RETURN(1);
|
||||
if (opt_xml)
|
||||
print_xml_tag(md_result_file, "", "\n", "database", "name=", database, NullS);
|
||||
if (lock_tables)
|
||||
@@ -2895,7 +2923,7 @@ static int dump_all_tables_in_db(char *database)
|
||||
fprintf(md_result_file,"\n--\n-- Flush Grant Tables \n--\n");
|
||||
fprintf(md_result_file,"\n/*! FLUSH PRIVILEGES */;\n");
|
||||
}
|
||||
return 0;
|
||||
DBUG_RETURN(0);
|
||||
} /* dump_all_tables_in_db */
|
||||
|
||||
|
||||
@@ -3257,7 +3285,6 @@ static void print_value(FILE *file, MYSQL_RES *result, MYSQL_ROW row,
|
||||
|
||||
|
||||
/*
|
||||
|
||||
SYNOPSIS
|
||||
|
||||
Check if we the table is one of the table types that should be ignored:
|
||||
@@ -3297,8 +3324,8 @@ char check_if_ignore_table(const char *table_name, char *table_type)
|
||||
{
|
||||
if (mysql_errno(mysql) != ER_PARSE_ERROR)
|
||||
{ /* If old MySQL version */
|
||||
verbose_msg("-- Warning: Couldn't get status information for " \
|
||||
"table %s (%s)\n", table_name,mysql_error(mysql));
|
||||
verbose_msg("-- Warning: Couldn't get status information for "
|
||||
"table %s (%s)\n", table_name, mysql_error(mysql));
|
||||
DBUG_RETURN(result); /* assume table is ok */
|
||||
}
|
||||
}
|
||||
@@ -3653,19 +3680,24 @@ static my_bool get_view_structure(char *table, char* db)
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
int exit_code;
|
||||
MY_INIT("mysqldump");
|
||||
|
||||
compatible_mode_normal_str[0]= 0;
|
||||
default_charset= (char *)mysql_universal_client_charset;
|
||||
bzero((char*) &ignore_table, sizeof(ignore_table));
|
||||
|
||||
if (get_options(&argc, &argv))
|
||||
exit_code= get_options(&argc, &argv);
|
||||
if (exit_code)
|
||||
{
|
||||
my_end(0);
|
||||
exit(EX_USAGE);
|
||||
free_resources(0);
|
||||
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);
|
||||
}
|
||||
if (!path)
|
||||
write_header(md_result_file, *argv);
|
||||
|
||||
@@ -3712,15 +3744,6 @@ err:
|
||||
dbDisconnect(current_host);
|
||||
if (!path)
|
||||
write_footer(md_result_file);
|
||||
if (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);
|
||||
my_end(0);
|
||||
free_resources();
|
||||
return(first_error);
|
||||
} /* main */
|
||||
|
@@ -434,7 +434,7 @@ rl_translate_keyseq (seq, array, len)
|
||||
{
|
||||
register int i, c, l, temp;
|
||||
|
||||
for (i = l = 0; c = seq[i]; i++)
|
||||
for (i = l = 0; (c = seq[i]); i++)
|
||||
{
|
||||
if (c == '\\')
|
||||
{
|
||||
@@ -765,8 +765,8 @@ _rl_read_file (filename, sizep)
|
||||
|
||||
/* Re-read the current keybindings file. */
|
||||
int
|
||||
rl_re_read_init_file (count, ignore)
|
||||
int count, ignore;
|
||||
rl_re_read_init_file (int count __attribute__((unused)),
|
||||
int ignore __attribute__((unused)))
|
||||
{
|
||||
int r;
|
||||
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. */
|
||||
static int
|
||||
parser_else (args)
|
||||
char *args;
|
||||
parser_else (char *args __attribute__((unused)))
|
||||
{
|
||||
register int i;
|
||||
|
||||
@@ -1018,8 +1017,7 @@ parser_else (args)
|
||||
/* Terminate a conditional, popping the value of
|
||||
_rl_parsing_conditionalized_out from the stack. */
|
||||
static int
|
||||
parser_endif (args)
|
||||
char *args;
|
||||
parser_endif (char *args __attribute__((unused)))
|
||||
{
|
||||
if (if_stack_depth)
|
||||
_rl_parsing_conditionalized_out = if_stack[--if_stack_depth];
|
||||
@@ -1142,7 +1140,7 @@ rl_parse_and_bind (string)
|
||||
{
|
||||
int passc = 0;
|
||||
|
||||
for (i = 1; c = string[i]; i++)
|
||||
for (i = 1; (c = string[i]); i++)
|
||||
{
|
||||
if (passc)
|
||||
{
|
||||
@@ -1218,7 +1216,7 @@ rl_parse_and_bind (string)
|
||||
{
|
||||
int delimiter = string[i++], passc;
|
||||
|
||||
for (passc = 0; c = string[i]; i++)
|
||||
for (passc = 0; (c = string[i]); i++)
|
||||
{
|
||||
if (passc)
|
||||
{
|
||||
@@ -1377,7 +1375,7 @@ static struct {
|
||||
#if defined (VISIBLE_STATS)
|
||||
{ "visible-stats", &rl_visible_stats, 0 },
|
||||
#endif /* VISIBLE_STATS */
|
||||
{ (char *)NULL, (int *)NULL }
|
||||
{ (char *)NULL, (int *)NULL, 0 }
|
||||
};
|
||||
|
||||
static int
|
||||
@@ -1446,7 +1444,7 @@ static struct {
|
||||
{ "editing-mode", V_STRING, sv_editmode },
|
||||
{ "isearch-terminators", V_STRING, sv_isrchterm },
|
||||
{ "keymap", V_STRING, sv_keymap },
|
||||
{ (char *)NULL, 0 }
|
||||
{ (char *)NULL, 0, 0 }
|
||||
};
|
||||
|
||||
static int
|
||||
@@ -1466,7 +1464,7 @@ find_string_var (name)
|
||||
values result in 0 (false). */
|
||||
static int
|
||||
bool_to_int (value)
|
||||
char *value;
|
||||
const char *value;
|
||||
{
|
||||
return (value == 0 || *value == '\0' ||
|
||||
(_rl_stricmp (value, "on") == 0) ||
|
||||
@@ -1725,13 +1723,13 @@ char *
|
||||
rl_get_keymap_name_from_edit_mode ()
|
||||
{
|
||||
if (rl_editing_mode == emacs_mode)
|
||||
return "emacs";
|
||||
return (char*) "emacs";
|
||||
#if defined (VI_MODE)
|
||||
else if (rl_editing_mode == vi_mode)
|
||||
return "vi";
|
||||
return (char*) "vi";
|
||||
#endif /* VI_MODE */
|
||||
else
|
||||
return "none";
|
||||
return (char*) "none";
|
||||
}
|
||||
|
||||
/* **************************************************************** */
|
||||
@@ -1966,7 +1964,7 @@ rl_function_dumper (print_readably)
|
||||
|
||||
fprintf (rl_outstream, "\n");
|
||||
|
||||
for (i = 0; name = names[i]; i++)
|
||||
for (i = 0; (name = names[i]); i++)
|
||||
{
|
||||
rl_command_func_t *function;
|
||||
char **invokers;
|
||||
@@ -2025,8 +2023,8 @@ rl_function_dumper (print_readably)
|
||||
rl_outstream. If an explicit argument is given, then print
|
||||
the output in such a way that it can be read back in. */
|
||||
int
|
||||
rl_dump_functions (count, key)
|
||||
int count, key;
|
||||
rl_dump_functions (int count __attribute__((unused)),
|
||||
int key __attribute__((unused)))
|
||||
{
|
||||
if (rl_dispatching)
|
||||
fprintf (rl_outstream, "\r\n");
|
||||
@@ -2105,8 +2103,7 @@ rl_macro_dumper (print_readably)
|
||||
}
|
||||
|
||||
int
|
||||
rl_dump_macros (count, key)
|
||||
int count, key;
|
||||
rl_dump_macros(int count __attribute__((unused)), int key __attribute__((unused)))
|
||||
{
|
||||
if (rl_dispatching)
|
||||
fprintf (rl_outstream, "\r\n");
|
||||
@@ -2195,8 +2192,7 @@ rl_variable_dumper (print_readably)
|
||||
rl_outstream. If an explicit argument is given, then print
|
||||
the output in such a way that it can be read back in. */
|
||||
int
|
||||
rl_dump_variables (count, key)
|
||||
int count, key;
|
||||
rl_dump_variables(int count __attribute__((unused)), int key __attribute__((unused)))
|
||||
{
|
||||
if (rl_dispatching)
|
||||
fprintf (rl_outstream, "\r\n");
|
||||
|
@@ -59,7 +59,11 @@
|
||||
#define largest_char 255 /* Largest character value. */
|
||||
|
||||
#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)
|
||||
#endif
|
||||
|
||||
#define CTRL(c) ((c) & control_character_mask)
|
||||
#define META(c) ((c) | meta_character_bit)
|
||||
|
@@ -360,15 +360,15 @@ rl_complete (ignore, invoking_key)
|
||||
|
||||
/* List the possible completions. See description of rl_complete (). */
|
||||
int
|
||||
rl_possible_completions (ignore, invoking_key)
|
||||
int ignore, invoking_key;
|
||||
rl_possible_completions (int ignore __attribute__((unused)),
|
||||
int invoking_key __attribute__((unused)))
|
||||
{
|
||||
return (rl_complete_internal ('?'));
|
||||
}
|
||||
|
||||
int
|
||||
rl_insert_completions (ignore, invoking_key)
|
||||
int ignore, invoking_key;
|
||||
rl_insert_completions (int ignore __attribute__((unused)),
|
||||
int invoking_key __attribute__((unused)))
|
||||
{
|
||||
return (rl_complete_internal ('*'));
|
||||
}
|
||||
@@ -760,10 +760,7 @@ print_filename (to_print, full_pathname)
|
||||
}
|
||||
|
||||
static char *
|
||||
rl_quote_filename (s, rtype, qcp)
|
||||
char *s;
|
||||
int rtype;
|
||||
char *qcp;
|
||||
rl_quote_filename (char *s, int rtype __attribute__((unused)), char *qcp)
|
||||
{
|
||||
char *r;
|
||||
|
||||
@@ -871,7 +868,7 @@ _rl_find_completion_word (fp, dp)
|
||||
completion, so use the word break characters to find the
|
||||
substring on which to complete. */
|
||||
#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
|
||||
while (--rl_point)
|
||||
#endif
|
||||
@@ -1805,7 +1802,7 @@ rl_completion_matches (text, entry_function)
|
||||
match_list = (char **)xmalloc ((match_list_size + 1) * sizeof (char *));
|
||||
match_list[1] = (char *)NULL;
|
||||
|
||||
while (string = (*entry_function) (text, matches))
|
||||
while ((string = (*entry_function) (text, matches)))
|
||||
{
|
||||
if (matches + 1 == match_list_size)
|
||||
match_list = (char **)xrealloc
|
||||
@@ -1855,7 +1852,7 @@ rl_username_completion_function (text, state)
|
||||
setpwent ();
|
||||
}
|
||||
|
||||
while (entry = getpwent ())
|
||||
while ((entry = getpwent ()))
|
||||
{
|
||||
/* Null usernames should result in all users as possible completions. */
|
||||
if (namelen == 0 || (STREQN (username, entry->pw_name, namelen)))
|
||||
@@ -2091,8 +2088,7 @@ rl_filename_completion_function (text, state)
|
||||
hit the end of the match list, we restore the original unmatched text,
|
||||
ring the bell, and reset the counter to zero. */
|
||||
int
|
||||
rl_menu_complete (count, ignore)
|
||||
int count, ignore;
|
||||
rl_menu_complete (int count, int ignore __attribute__((unused)))
|
||||
{
|
||||
rl_compentry_func_t *our_func;
|
||||
int matching_filenames, found_quote;
|
||||
|
@@ -218,7 +218,7 @@ expand_prompt (pmt, lp, lip, niflp, vlp)
|
||||
if (niflp)
|
||||
*niflp = 0;
|
||||
if (vlp)
|
||||
*vlp = lp ? *lp : strlen (r);
|
||||
*vlp = lp ? *lp : (int) strlen (r);
|
||||
return r;
|
||||
}
|
||||
|
||||
@@ -435,7 +435,7 @@ rl_redisplay ()
|
||||
return;
|
||||
|
||||
if (!rl_display_prompt)
|
||||
rl_display_prompt = "";
|
||||
rl_display_prompt = (char*) "";
|
||||
|
||||
if (invisible_line == 0)
|
||||
{
|
||||
@@ -757,7 +757,7 @@ rl_redisplay ()
|
||||
c_pos = out;
|
||||
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];
|
||||
for (i = 0; i < wc_width; i++)
|
||||
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 INV_LLEN(l) (inv_lbreaks[l+1] - inv_lbreaks[l])
|
||||
#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])
|
||||
|
||||
/* For each line in the buffer, do the updating display. */
|
||||
@@ -876,7 +876,7 @@ rl_redisplay ()
|
||||
_rl_move_vert (linenum);
|
||||
_rl_move_cursor_relative (0, tt);
|
||||
_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;
|
||||
@@ -1086,7 +1086,7 @@ update_line (old, new, current_line, omax, nmax, inv_botlin)
|
||||
int col_lendiff, col_temp;
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
mbstate_t ps_new, ps_old;
|
||||
int new_offset, old_offset, tmp;
|
||||
int new_offset, old_offset;
|
||||
#endif
|
||||
|
||||
/* 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_display_prompt = rl_prompt ? rl_prompt : "";
|
||||
rl_display_prompt = rl_prompt ? rl_prompt : (char*) "";
|
||||
forced_display = 1;
|
||||
return 0;
|
||||
}
|
||||
@@ -2212,7 +2212,7 @@ _rl_col_width (str, start, end)
|
||||
int start, end;
|
||||
{
|
||||
wchar_t wc;
|
||||
mbstate_t ps = {0};
|
||||
mbstate_t ps;
|
||||
int tmp, point, width, max;
|
||||
|
||||
if (end <= start)
|
||||
@@ -2221,6 +2221,7 @@ _rl_col_width (str, start, end)
|
||||
point = 0;
|
||||
max = end;
|
||||
|
||||
memset (&ps, 0, sizeof(ps));
|
||||
while (point < start)
|
||||
{
|
||||
tmp = mbrlen (str + point, max, &ps);
|
||||
|
@@ -87,14 +87,14 @@ char history_comment_char = '\0';
|
||||
|
||||
/* The list of characters which inhibit the expansion of text if found
|
||||
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.
|
||||
The default is 0. */
|
||||
int history_quotes_inhibit_expansion = 0;
|
||||
|
||||
/* 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
|
||||
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. */
|
||||
for (local_index = i; c = string[i]; i++)
|
||||
for (local_index = i; (c = string[i]); i++)
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
if (MB_CUR_MAX > 1 && rl_byte_oriented == 0)
|
||||
{
|
||||
|
@@ -405,7 +405,7 @@ rl_read_key ()
|
||||
else
|
||||
{
|
||||
/* If input is coming from a macro, then use that. */
|
||||
if (c = _rl_next_macro_key ())
|
||||
if ((c= _rl_next_macro_key ()))
|
||||
return (c);
|
||||
|
||||
/* If the user has an event function, then call it periodically. */
|
||||
|
@@ -68,7 +68,7 @@ static char *prev_line_found;
|
||||
static char *last_isearch_string;
|
||||
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
|
||||
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
|
||||
-1, then this line is the starting one. */
|
||||
static void
|
||||
rl_display_search (search_string, reverse_p, where)
|
||||
char *search_string;
|
||||
int reverse_p, where;
|
||||
rl_display_search (char *search_string, int reverse_p,
|
||||
int where __attribute__((unused)))
|
||||
{
|
||||
char *message;
|
||||
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
|
||||
backwards. */
|
||||
static int
|
||||
rl_search_history (direction, invoking_key)
|
||||
int direction, invoking_key;
|
||||
rl_search_history (int direction, int invoking_key __attribute__((unused)))
|
||||
{
|
||||
/* The string that the user types in to search for. */
|
||||
char *search_string;
|
||||
|
@@ -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
|
||||
of kill material. */
|
||||
int
|
||||
rl_set_retained_kills (num)
|
||||
int num;
|
||||
rl_set_retained_kills (int num __attribute__((unused)))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -293,8 +292,8 @@ rl_backward_kill_line (direction, ignore)
|
||||
|
||||
/* Kill the whole line, no matter where point is. */
|
||||
int
|
||||
rl_kill_full_line (count, ignore)
|
||||
int count, ignore;
|
||||
rl_kill_full_line (int count __attribute__((unused)),
|
||||
int ignore __attribute__((unused)))
|
||||
{
|
||||
rl_begin_undo_group ();
|
||||
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
|
||||
using behaviour that they expect. */
|
||||
int
|
||||
rl_unix_word_rubout (count, key)
|
||||
int count, key;
|
||||
rl_unix_word_rubout (int count, int key __attribute__((unused)))
|
||||
{
|
||||
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
|
||||
deletes backward to directory separator (`/') or whitespace. */
|
||||
int
|
||||
rl_unix_filename_rubout (count, key)
|
||||
int count, key;
|
||||
rl_unix_filename_rubout (int count, int key __attribute__((unused)))
|
||||
{
|
||||
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
|
||||
doing. */
|
||||
int
|
||||
rl_unix_line_discard (count, key)
|
||||
int count, key;
|
||||
rl_unix_line_discard (int count __attribute__((unused)),
|
||||
int key __attribute__((unused)))
|
||||
{
|
||||
if (rl_point == 0)
|
||||
rl_ding ();
|
||||
@@ -425,16 +422,16 @@ region_kill_internal (delete)
|
||||
|
||||
/* Copy the text in the region to the kill ring. */
|
||||
int
|
||||
rl_copy_region_to_kill (count, ignore)
|
||||
int count, ignore;
|
||||
rl_copy_region_to_kill (int count __attribute__((unused)),
|
||||
int key __attribute__((unused)))
|
||||
{
|
||||
return (region_kill_internal (0));
|
||||
}
|
||||
|
||||
/* Kill the text between the point and mark. */
|
||||
int
|
||||
rl_kill_region (count, ignore)
|
||||
int count, ignore;
|
||||
rl_kill_region (int count __attribute__((unused)),
|
||||
int ignore __attribute__((unused)))
|
||||
{
|
||||
int r, npoint;
|
||||
|
||||
@@ -498,8 +495,7 @@ rl_copy_backward_word (count, key)
|
||||
|
||||
/* Yank back the last killed text. This ignores arguments. */
|
||||
int
|
||||
rl_yank (count, ignore)
|
||||
int count, ignore;
|
||||
rl_yank (int count __attribute__((unused)), int ignore __attribute__((unused)))
|
||||
{
|
||||
if (rl_kill_ring == 0)
|
||||
{
|
||||
@@ -517,8 +513,7 @@ rl_yank (count, ignore)
|
||||
delete that text from the line, rotate the index down, and
|
||||
yank back some other text. */
|
||||
int
|
||||
rl_yank_pop (count, key)
|
||||
int count, key;
|
||||
rl_yank_pop (int count __attribute__((unused)), int key __attribute__((unused)))
|
||||
{
|
||||
int l, n;
|
||||
|
||||
|
@@ -189,8 +189,8 @@ _rl_kill_kbd_macro ()
|
||||
definition to the end of the existing macro, and start by
|
||||
re-executing the existing macro. */
|
||||
int
|
||||
rl_start_kbd_macro (ignore1, ignore2)
|
||||
int ignore1, ignore2;
|
||||
rl_start_kbd_macro (int ignore1 __attribute__((unused)),
|
||||
int ignore2 __attribute__((unused)))
|
||||
{
|
||||
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,
|
||||
that many times, counting the definition as the first time. */
|
||||
int
|
||||
rl_end_kbd_macro (count, ignore)
|
||||
int count, ignore;
|
||||
rl_end_kbd_macro (int count, int ignore __attribute__((unused)))
|
||||
{
|
||||
if (RL_ISSTATE (RL_STATE_MACRODEF) == 0)
|
||||
{
|
||||
@@ -234,8 +233,7 @@ rl_end_kbd_macro (count, ignore)
|
||||
/* Execute the most recently defined keyboard macro.
|
||||
COUNT says how many times to execute it. */
|
||||
int
|
||||
rl_call_last_kbd_macro (count, ignore)
|
||||
int count, ignore;
|
||||
rl_call_last_kbd_macro (int count, int ignore __attribute__((unused)))
|
||||
{
|
||||
if (current_macro == 0)
|
||||
_rl_abort_internal ();
|
||||
|
@@ -154,8 +154,7 @@ rl_digit_loop ()
|
||||
|
||||
/* Add the current digit to the argument in progress. */
|
||||
int
|
||||
rl_digit_argument (ignore, key)
|
||||
int ignore, key;
|
||||
rl_digit_argument (int ignore __attribute__((unused)), int key)
|
||||
{
|
||||
rl_execute_next (key);
|
||||
return (rl_digit_loop ());
|
||||
@@ -184,8 +183,8 @@ _rl_init_argument ()
|
||||
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. */
|
||||
int
|
||||
rl_universal_argument (count, key)
|
||||
int count, key;
|
||||
rl_universal_argument (int count __attribute__((unused)),
|
||||
int key __attribute__((unused)))
|
||||
{
|
||||
rl_numeric_arg *= 4;
|
||||
return (rl_digit_loop ());
|
||||
@@ -314,9 +313,7 @@ _rl_history_set_point ()
|
||||
}
|
||||
|
||||
void
|
||||
rl_replace_from_history (entry, flags)
|
||||
HIST_ENTRY *entry;
|
||||
int flags; /* currently unused */
|
||||
rl_replace_from_history (HIST_ENTRY *entry, int flags __attribute__((unused)))
|
||||
{
|
||||
/* 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. */
|
||||
@@ -342,16 +339,15 @@ rl_replace_from_history (entry, flags)
|
||||
|
||||
/* Meta-< goes to the start of the history. */
|
||||
int
|
||||
rl_beginning_of_history (count, key)
|
||||
int count, key;
|
||||
rl_beginning_of_history (int count __attribute__((unused)), int key)
|
||||
{
|
||||
return (rl_get_previous_history (1 + where_history (), key));
|
||||
}
|
||||
|
||||
/* Meta-> goes to the end of the history. (The current line). */
|
||||
int
|
||||
rl_end_of_history (count, key)
|
||||
int count, key;
|
||||
rl_end_of_history (int count __attribute__((unused)),
|
||||
int key __attribute__((unused)))
|
||||
{
|
||||
rl_maybe_replace_line ();
|
||||
using_history ();
|
||||
@@ -455,8 +451,7 @@ rl_get_previous_history (count, key)
|
||||
/* **************************************************************** */
|
||||
/* How to toggle back and forth between editing modes. */
|
||||
int
|
||||
rl_vi_editing_mode (count, key)
|
||||
int count, key;
|
||||
rl_vi_editing_mode (int count __attribute__((unused)), int key)
|
||||
{
|
||||
#if defined (VI_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
|
||||
rl_emacs_editing_mode (count, key)
|
||||
int count, key;
|
||||
rl_emacs_editing_mode (int count __attribute__((unused)),
|
||||
int key __attribute__((unused)))
|
||||
{
|
||||
rl_editing_mode = emacs_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. */
|
||||
void
|
||||
_rl_set_insert_mode (im, force)
|
||||
int im, force;
|
||||
_rl_set_insert_mode (int im, int force __attribute__((unused)))
|
||||
{
|
||||
#ifdef CURSOR_MODE
|
||||
_rl_set_cursor (im, force);
|
||||
@@ -492,8 +486,7 @@ _rl_set_insert_mode (im, force)
|
||||
/* Toggle overwrite mode. A positive explicit argument selects overwrite
|
||||
mode. A negative or zero explicit argument selects insert mode. */
|
||||
int
|
||||
rl_overwrite_mode (count, key)
|
||||
int count, key;
|
||||
rl_overwrite_mode (int count, int key __attribute__((unused)))
|
||||
{
|
||||
if (rl_explicit_arg == 0)
|
||||
_rl_set_insert_mode (rl_insert_mode ^ 1, 0);
|
||||
|
@@ -111,7 +111,7 @@ _rl_init_eightbit ()
|
||||
if (lspec == 0 || *lspec == 0)
|
||||
lspec = setlocale (LC_CTYPE, (char *)NULL);
|
||||
if (lspec == 0)
|
||||
lspec = "";
|
||||
lspec = (char*) "";
|
||||
t = setlocale (LC_CTYPE, lspec);
|
||||
|
||||
if (t && *t && (t[0] != 'C' || t[1]) && (STREQ (t, "POSIX") == 0))
|
||||
|
@@ -83,7 +83,9 @@ static void bind_arrow_keys_internal PARAMS((Keymap));
|
||||
static void bind_arrow_keys PARAMS((void));
|
||||
|
||||
static void readline_default_bindings PARAMS((void));
|
||||
#ifdef NOT_USED
|
||||
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
|
||||
interested in back to rl_insert and read the new ones. */
|
||||
#ifdef NOT_USED
|
||||
static void
|
||||
reset_default_bindings ()
|
||||
{
|
||||
rl_tty_unset_default_bindings (_rl_keymap);
|
||||
rl_tty_set_default_bindings (_rl_keymap);
|
||||
}
|
||||
#endif
|
||||
|
||||
/* Bind some common arrow key sequences in MAP. */
|
||||
static void
|
||||
|
@@ -716,8 +716,7 @@ rl_deprep_terminal ()
|
||||
/* **************************************************************** */
|
||||
|
||||
int
|
||||
rl_restart_output (count, key)
|
||||
int count, key;
|
||||
rl_restart_output(int count __attribute__((unused)), int key __attribute__((unused)))
|
||||
{
|
||||
int fildes = fileno (rl_outstream);
|
||||
#if defined (TIOCSTART)
|
||||
@@ -749,8 +748,7 @@ rl_restart_output (count, key)
|
||||
}
|
||||
|
||||
int
|
||||
rl_stop_output (count, key)
|
||||
int count, key;
|
||||
rl_stop_output(int count __attribute__((unused)), int key __attribute__((unused)))
|
||||
{
|
||||
int fildes = fileno (rl_instream);
|
||||
|
||||
@@ -867,7 +865,6 @@ rltty_set_default_bindings (kmap)
|
||||
{
|
||||
TIOTYPE ttybuff;
|
||||
int tty;
|
||||
static int called = 0;
|
||||
|
||||
tty = fileno (rl_instream);
|
||||
|
||||
|
@@ -303,8 +303,7 @@ noninc_search (dir, pchar)
|
||||
/* Search forward through the history list for a string. If the vi-mode
|
||||
code calls this, KEY will be `?'. */
|
||||
int
|
||||
rl_noninc_forward_search (count, key)
|
||||
int count, key;
|
||||
rl_noninc_forward_search (int count __attribute__((unused)), int key)
|
||||
{
|
||||
noninc_search (1, (key == '?') ? '?' : 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
|
||||
calls this, KEY will be `/'. */
|
||||
int
|
||||
rl_noninc_reverse_search (count, key)
|
||||
int count, key;
|
||||
rl_noninc_reverse_search (int count __attribute__((unused)), int key)
|
||||
{
|
||||
noninc_search (-1, (key == '/') ? '/' : 0);
|
||||
return 0;
|
||||
@@ -323,8 +321,8 @@ rl_noninc_reverse_search (count, key)
|
||||
/* Search forward through the history list for the last string searched
|
||||
for. If there is no saved search string, abort. */
|
||||
int
|
||||
rl_noninc_forward_search_again (count, key)
|
||||
int count, key;
|
||||
rl_noninc_forward_search_again (int count __attribute__((unused)),
|
||||
int key __attribute__((unused)))
|
||||
{
|
||||
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
|
||||
for. If there is no saved search string, abort. */
|
||||
int
|
||||
rl_noninc_reverse_search_again (count, key)
|
||||
int count, key;
|
||||
rl_noninc_reverse_search_again (int count __attribute__((unused)),
|
||||
int key __attribute__((unused)))
|
||||
{
|
||||
if (!noninc_search_string)
|
||||
{
|
||||
|
@@ -344,7 +344,7 @@ get_term_capabilities (bp)
|
||||
#if !defined (__DJGPP__) /* XXX - doesn't DJGPP have a termcap library? */
|
||||
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);
|
||||
#endif
|
||||
tcap_initialized = 1;
|
||||
@@ -410,7 +410,7 @@ _rl_init_terminal_io (terminal_name)
|
||||
|
||||
/* Everything below here is used by the redisplay code (tputs). */
|
||||
_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_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;
|
||||
@@ -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
|
||||
change that later... */
|
||||
PC = '\0';
|
||||
BC = _rl_term_backspace = "\b";
|
||||
BC = _rl_term_backspace = (char*) "\b";
|
||||
UP = _rl_term_up;
|
||||
|
||||
return 0;
|
||||
@@ -442,7 +442,7 @@ _rl_init_terminal_io (terminal_name)
|
||||
UP = _rl_term_up;
|
||||
|
||||
if (!_rl_term_cr)
|
||||
_rl_term_cr = "\r";
|
||||
_rl_term_cr = (char*) "\r";
|
||||
|
||||
_rl_term_autowrap = tgetflag ("am") && tgetflag ("xn");
|
||||
|
||||
@@ -502,7 +502,7 @@ rl_get_termcap (cap)
|
||||
|
||||
if (tcap_initialized == 0)
|
||||
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)
|
||||
return *(tc_strings[i].tc_value);
|
||||
|
@@ -402,8 +402,7 @@ rl_backward (count, key)
|
||||
|
||||
/* Move to the beginning of the line. */
|
||||
int
|
||||
rl_beg_of_line (count, key)
|
||||
int count, key;
|
||||
rl_beg_of_line (int count __attribute__((unused)), int key __attribute__((unused)))
|
||||
{
|
||||
rl_point = 0;
|
||||
return 0;
|
||||
@@ -411,8 +410,7 @@ rl_beg_of_line (count, key)
|
||||
|
||||
/* Move to the end of the line. */
|
||||
int
|
||||
rl_end_of_line (count, key)
|
||||
int count, key;
|
||||
rl_end_of_line (int count __attribute__((unused)), int key __attribute__((unused)))
|
||||
{
|
||||
rl_point = rl_end;
|
||||
return 0;
|
||||
@@ -508,8 +506,7 @@ rl_backward_word (count, key)
|
||||
|
||||
/* Clear the current line. Numeric argument to C-l does this. */
|
||||
int
|
||||
rl_refresh_line (ignore1, ignore2)
|
||||
int ignore1, ignore2;
|
||||
rl_refresh_line (int count __attribute__((unused)), int key __attribute__((unused)))
|
||||
{
|
||||
int curr_line;
|
||||
|
||||
@@ -547,8 +544,7 @@ rl_clear_screen (count, key)
|
||||
}
|
||||
|
||||
int
|
||||
rl_arrow_keys (count, c)
|
||||
int count, c;
|
||||
rl_arrow_keys (int count, int c __attribute__((unused)))
|
||||
{
|
||||
int ch;
|
||||
|
||||
@@ -596,7 +592,7 @@ rl_arrow_keys (count, c)
|
||||
#ifdef HANDLE_MULTIBYTE
|
||||
static char pending_bytes[MB_LEN_MAX];
|
||||
static int pending_bytes_length = 0;
|
||||
static mbstate_t ps = {0};
|
||||
static mbstate_t ps;
|
||||
#endif
|
||||
|
||||
/* 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. */
|
||||
int
|
||||
rl_quoted_insert (count, key)
|
||||
int count, key;
|
||||
rl_quoted_insert (int count, int key __attribute__((unused)))
|
||||
{
|
||||
int c;
|
||||
|
||||
@@ -854,8 +849,7 @@ rl_quoted_insert (count, key)
|
||||
|
||||
/* Insert a tab character. */
|
||||
int
|
||||
rl_tab_insert (count, key)
|
||||
int count, key;
|
||||
rl_tab_insert (int count, int key __attribute__((unused)))
|
||||
{
|
||||
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
|
||||
meaning in the future. */
|
||||
int
|
||||
rl_newline (count, key)
|
||||
int count, key;
|
||||
rl_newline (int count __attribute__((unused)), int key __attribute__((unused)))
|
||||
{
|
||||
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 special cased. */
|
||||
int
|
||||
rl_do_lowercase_version (ignore1, ignore2)
|
||||
int ignore1, ignore2;
|
||||
rl_do_lowercase_version (int count __attribute__((unused)),
|
||||
int key __attribute__((unused)))
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
@@ -1093,8 +1086,8 @@ rl_rubout_or_delete (count, key)
|
||||
|
||||
/* Delete all spaces and tabs around point. */
|
||||
int
|
||||
rl_delete_horizontal_space (count, ignore)
|
||||
int count, ignore;
|
||||
rl_delete_horizontal_space (int count __attribute__((unused)),
|
||||
int key __attribute__((unused)))
|
||||
{
|
||||
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.
|
||||
A K*rn shell style function. */
|
||||
int
|
||||
rl_insert_comment (count, key)
|
||||
int count, key;
|
||||
rl_insert_comment (int count __attribute__((unused)), int key)
|
||||
{
|
||||
char *rl_comment_text;
|
||||
int rl_comment_len;
|
||||
|
||||
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)
|
||||
rl_insert_text (rl_comment_text);
|
||||
@@ -1173,24 +1165,21 @@ rl_insert_comment (count, key)
|
||||
|
||||
/* Uppercase the word at point. */
|
||||
int
|
||||
rl_upcase_word (count, key)
|
||||
int count, key;
|
||||
rl_upcase_word (int count, int key __attribute__((unused)))
|
||||
{
|
||||
return (rl_change_case (count, UpCase));
|
||||
}
|
||||
|
||||
/* Lowercase the word at point. */
|
||||
int
|
||||
rl_downcase_word (count, key)
|
||||
int count, key;
|
||||
rl_downcase_word (int count, int key __attribute__((unused)))
|
||||
{
|
||||
return (rl_change_case (count, DownCase));
|
||||
}
|
||||
|
||||
/* Upcase the first letter, downcase the rest. */
|
||||
int
|
||||
rl_capitalize_word (count, key)
|
||||
int count, key;
|
||||
rl_capitalize_word (int count, int key __attribute__((unused)))
|
||||
{
|
||||
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,
|
||||
then transpose the characters before point. */
|
||||
int
|
||||
rl_transpose_chars (count, key)
|
||||
int count, key;
|
||||
rl_transpose_chars (int count, int key __attribute__((unused)))
|
||||
{
|
||||
#if defined (HANDLE_MULTIBYTE)
|
||||
char *dummy;
|
||||
@@ -1486,15 +1474,13 @@ _rl_char_search (count, fdir, bdir)
|
||||
#endif /* !HANDLE_MULTIBYTE */
|
||||
|
||||
int
|
||||
rl_char_search (count, key)
|
||||
int count, key;
|
||||
rl_char_search (int count, int key __attribute__((unused)))
|
||||
{
|
||||
return (_rl_char_search (count, FFIND, BFIND));
|
||||
}
|
||||
|
||||
int
|
||||
rl_backward_char_search (count, key)
|
||||
int count, key;
|
||||
rl_backward_char_search (int count, int key __attribute__((unused)))
|
||||
{
|
||||
return (_rl_char_search (count, BFIND, FFIND));
|
||||
}
|
||||
@@ -1519,16 +1505,15 @@ _rl_set_mark_at_pos (position)
|
||||
|
||||
/* A bindable command to set the mark. */
|
||||
int
|
||||
rl_set_mark (count, key)
|
||||
int count, key;
|
||||
rl_set_mark (int count, int key __attribute__((unused)))
|
||||
{
|
||||
return (_rl_set_mark_at_pos (rl_explicit_arg ? count : rl_point));
|
||||
}
|
||||
|
||||
/* Exchange the position of mark and point. */
|
||||
int
|
||||
rl_exchange_point_and_mark (count, key)
|
||||
int count, key;
|
||||
rl_exchange_point_and_mark (int count __attribute__((unused)),
|
||||
int key __attribute__((unused)))
|
||||
{
|
||||
if (rl_mark > rl_end)
|
||||
rl_mark = -1;
|
||||
|
@@ -190,7 +190,7 @@ tilde_expand (string)
|
||||
int result_size, result_index;
|
||||
|
||||
result_index = result_size = 0;
|
||||
if (result = strchr (string, '~'))
|
||||
if ((result = strchr (string, '~')))
|
||||
result = (char *)xmalloc (result_size = (strlen (string) + 16));
|
||||
else
|
||||
result = (char *)xmalloc (result_size = (strlen (string) + 1));
|
||||
|
@@ -175,7 +175,7 @@ _rl_fix_last_undo_of_type (type, start, end)
|
||||
|
||||
for (rl = rl_undo_list; rl; rl = rl->next)
|
||||
{
|
||||
if (rl->what == type)
|
||||
if (rl->what == (uint) type)
|
||||
{
|
||||
rl->start = start;
|
||||
rl->end = end;
|
||||
@@ -226,8 +226,7 @@ rl_modifying (start, end)
|
||||
|
||||
/* Revert the current line to its previous state. */
|
||||
int
|
||||
rl_revert_line (count, key)
|
||||
int count, key;
|
||||
rl_revert_line (int count __attribute__((unused)), int key __attribute__((unused)))
|
||||
{
|
||||
if (!rl_undo_list)
|
||||
rl_ding ();
|
||||
@@ -241,8 +240,7 @@ rl_revert_line (count, key)
|
||||
|
||||
/* Do some undoing of things that were done. */
|
||||
int
|
||||
rl_undo_command (count, key)
|
||||
int count, key;
|
||||
rl_undo_command (int count, int key __attribute__((unused)))
|
||||
{
|
||||
if (count < 0)
|
||||
return 0; /* Nothing to do. */
|
||||
|
@@ -95,15 +95,13 @@ _rl_abort_internal ()
|
||||
}
|
||||
|
||||
int
|
||||
rl_abort (count, key)
|
||||
int count, key;
|
||||
rl_abort (int count __attribute__((unused)), int key __attribute__((unused)))
|
||||
{
|
||||
return (_rl_abort_internal ());
|
||||
}
|
||||
|
||||
int
|
||||
rl_tty_status (count, key)
|
||||
int count, key;
|
||||
rl_tty_status (int count __attribute__((unused)), int key __attribute__((unused)))
|
||||
{
|
||||
#if defined (TIOCSTAT)
|
||||
ioctl (1, TIOCSTAT, (char *)0);
|
||||
@@ -152,8 +150,7 @@ rl_extend_line_buffer (len)
|
||||
|
||||
/* A function for simple tilde expansion. */
|
||||
int
|
||||
rl_tilde_expand (ignore, key)
|
||||
int ignore, key;
|
||||
rl_tilde_expand (int ignore __attribute__((unused)), int key __attribute__((unused)))
|
||||
{
|
||||
register int start, end;
|
||||
char *homedir, *temp;
|
||||
|
@@ -112,7 +112,7 @@ _rl_vi_initialize_line ()
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -166,8 +166,7 @@ _rl_vi_stuff_insert (count)
|
||||
redo a text modification command. The default for _rl_vi_last_command
|
||||
puts you back into insert mode. */
|
||||
int
|
||||
rl_vi_redo (count, c)
|
||||
int count, c;
|
||||
rl_vi_redo (int count, int c __attribute__((unused)))
|
||||
{
|
||||
int r;
|
||||
|
||||
@@ -205,8 +204,7 @@ rl_vi_undo (count, key)
|
||||
|
||||
/* Yank the nth arg from the previous line into this line at point. */
|
||||
int
|
||||
rl_vi_yank_arg (count, key)
|
||||
int count, key;
|
||||
rl_vi_yank_arg (int count, int key __attribute__((unused)))
|
||||
{
|
||||
/* 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. */
|
||||
@@ -286,8 +284,7 @@ rl_vi_search (count, key)
|
||||
|
||||
/* Completion, from vi's point of view. */
|
||||
int
|
||||
rl_vi_complete (ignore, key)
|
||||
int ignore, key;
|
||||
rl_vi_complete (int ignore __attribute__((unused)), int key)
|
||||
{
|
||||
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. */
|
||||
int
|
||||
rl_vi_tilde_expand (ignore, key)
|
||||
int ignore, key;
|
||||
rl_vi_tilde_expand (int ignore __attribute__((unused)), int key)
|
||||
{
|
||||
rl_tilde_expand (0, key);
|
||||
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. */
|
||||
int
|
||||
rl_vi_fWord (count, ignore)
|
||||
int count, ignore;
|
||||
rl_vi_fWord (int count, int ignore __attribute__((unused)))
|
||||
{
|
||||
while (count-- && rl_point < (rl_end - 1))
|
||||
{
|
||||
@@ -401,8 +396,7 @@ rl_vi_fWord (count, ignore)
|
||||
}
|
||||
|
||||
int
|
||||
rl_vi_bWord (count, ignore)
|
||||
int count, ignore;
|
||||
rl_vi_bWord (int count, int ignore __attribute__((unused)))
|
||||
{
|
||||
while (count-- && rl_point > 0)
|
||||
{
|
||||
@@ -425,8 +419,7 @@ rl_vi_bWord (count, ignore)
|
||||
}
|
||||
|
||||
int
|
||||
rl_vi_eWord (count, ignore)
|
||||
int count, ignore;
|
||||
rl_vi_eWord(int count, int ignore __attribute__((unused)))
|
||||
{
|
||||
while (count-- && rl_point < (rl_end - 1))
|
||||
{
|
||||
@@ -456,8 +449,7 @@ rl_vi_eWord (count, ignore)
|
||||
}
|
||||
|
||||
int
|
||||
rl_vi_fword (count, ignore)
|
||||
int count, ignore;
|
||||
rl_vi_fword (int count, int ignore __attribute__((unused)))
|
||||
{
|
||||
while (count-- && rl_point < (rl_end - 1))
|
||||
{
|
||||
@@ -482,8 +474,7 @@ rl_vi_fword (count, ignore)
|
||||
}
|
||||
|
||||
int
|
||||
rl_vi_bword (count, ignore)
|
||||
int count, ignore;
|
||||
rl_vi_bword (int count, int ignore __attribute__((unused)))
|
||||
{
|
||||
while (count-- && rl_point > 0)
|
||||
{
|
||||
@@ -521,8 +512,7 @@ rl_vi_bword (count, ignore)
|
||||
}
|
||||
|
||||
int
|
||||
rl_vi_eword (count, ignore)
|
||||
int count, ignore;
|
||||
rl_vi_eword (int count, int ignore __attribute__((unused)))
|
||||
{
|
||||
while (count-- && rl_point < rl_end - 1)
|
||||
{
|
||||
@@ -546,8 +536,7 @@ rl_vi_eword (count, ignore)
|
||||
}
|
||||
|
||||
int
|
||||
rl_vi_insert_beg (count, key)
|
||||
int count, key;
|
||||
rl_vi_insert_beg (int count __attribute__((unused)), int key)
|
||||
{
|
||||
rl_beg_of_line (1, key);
|
||||
rl_vi_insertion_mode (1, key);
|
||||
@@ -555,8 +544,7 @@ rl_vi_insert_beg (count, key)
|
||||
}
|
||||
|
||||
int
|
||||
rl_vi_append_mode (count, key)
|
||||
int count, key;
|
||||
rl_vi_append_mode (int count __attribute__((unused)), int key)
|
||||
{
|
||||
if (rl_point < rl_end)
|
||||
{
|
||||
@@ -575,8 +563,7 @@ rl_vi_append_mode (count, key)
|
||||
}
|
||||
|
||||
int
|
||||
rl_vi_append_eol (count, key)
|
||||
int count, key;
|
||||
rl_vi_append_eol (int count __attribute__((unused)), int key)
|
||||
{
|
||||
rl_end_of_line (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. */
|
||||
int
|
||||
rl_vi_eof_maybe (count, c)
|
||||
int count, c;
|
||||
rl_vi_eof_maybe (int count __attribute__((unused)), int c __attribute__((unused)))
|
||||
{
|
||||
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 keymaps. */
|
||||
int
|
||||
rl_vi_insertion_mode (count, key)
|
||||
int count, key;
|
||||
rl_vi_insertion_mode (int count __attribute__((unused)), int key)
|
||||
{
|
||||
_rl_keymap = vi_insertion_keymap;
|
||||
_rl_vi_last_key_before_insert = key;
|
||||
@@ -659,8 +644,7 @@ _rl_vi_done_inserting ()
|
||||
}
|
||||
|
||||
int
|
||||
rl_vi_movement_mode (count, key)
|
||||
int count, key;
|
||||
rl_vi_movement_mode (int count __attribute__((unused)), int key)
|
||||
{
|
||||
if (rl_point > 0)
|
||||
rl_backward_char (1, key);
|
||||
@@ -729,8 +713,7 @@ _rl_vi_change_mbchar_case (count)
|
||||
#endif
|
||||
|
||||
int
|
||||
rl_vi_change_case (count, ignore)
|
||||
int count, ignore;
|
||||
rl_vi_change_case (int count, int ignore __attribute__((unused)))
|
||||
{
|
||||
int c, p;
|
||||
|
||||
@@ -959,8 +942,7 @@ rl_digit_loop1 ()
|
||||
}
|
||||
|
||||
int
|
||||
rl_vi_delete_to (count, key)
|
||||
int count, key;
|
||||
rl_vi_delete_to (int count __attribute__((unused)), int key)
|
||||
{
|
||||
int c;
|
||||
|
||||
@@ -985,8 +967,7 @@ rl_vi_delete_to (count, key)
|
||||
}
|
||||
|
||||
int
|
||||
rl_vi_change_to (count, key)
|
||||
int count, key;
|
||||
rl_vi_change_to (int count __attribute__((unused)), int key)
|
||||
{
|
||||
int c, start_pos;
|
||||
|
||||
@@ -1038,8 +1019,7 @@ rl_vi_change_to (count, key)
|
||||
}
|
||||
|
||||
int
|
||||
rl_vi_yank_to (count, key)
|
||||
int count, key;
|
||||
rl_vi_yank_to (int count __attribute__((unused)), int key)
|
||||
{
|
||||
int c, save = rl_point;
|
||||
|
||||
@@ -1094,8 +1074,7 @@ rl_vi_delete (count, key)
|
||||
}
|
||||
|
||||
int
|
||||
rl_vi_back_to_indent (count, key)
|
||||
int count, key;
|
||||
rl_vi_back_to_indent (int count __attribute__((unused)), int key)
|
||||
{
|
||||
rl_beg_of_line (1, key);
|
||||
while (rl_point < rl_end && whitespace (rl_line_buffer[rl_point]))
|
||||
@@ -1104,8 +1083,7 @@ rl_vi_back_to_indent (count, key)
|
||||
}
|
||||
|
||||
int
|
||||
rl_vi_first_print (count, key)
|
||||
int count, key;
|
||||
rl_vi_first_print (int count __attribute__((unused)), int key)
|
||||
{
|
||||
return (rl_vi_back_to_indent (1, key));
|
||||
}
|
||||
@@ -1173,8 +1151,7 @@ rl_vi_char_search (count, key)
|
||||
|
||||
/* Match brackets */
|
||||
int
|
||||
rl_vi_match (ignore, key)
|
||||
int ignore, key;
|
||||
rl_vi_match (int ignore __attribute__((unused)), int key)
|
||||
{
|
||||
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
|
||||
this right. */
|
||||
int
|
||||
rl_vi_change_char (count, key)
|
||||
int count, key;
|
||||
rl_vi_change_char (int count, int key __attribute__((unused)))
|
||||
{
|
||||
int c, p;
|
||||
|
||||
@@ -1389,8 +1365,7 @@ rl_vi_overstrike_delete (count, key)
|
||||
}
|
||||
|
||||
int
|
||||
rl_vi_replace (count, key)
|
||||
int count, key;
|
||||
rl_vi_replace (int count __attribute__((unused)), int key __attribute__((unused)))
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -1450,8 +1425,7 @@ rl_vi_possible_completions()
|
||||
|
||||
/* Functions to save and restore marks. */
|
||||
int
|
||||
rl_vi_set_mark (count, key)
|
||||
int count, key;
|
||||
rl_vi_set_mark (int count __attribute__((unused)), int key __attribute__((unused)))
|
||||
{
|
||||
int ch;
|
||||
|
||||
@@ -1470,8 +1444,7 @@ rl_vi_set_mark (count, key)
|
||||
}
|
||||
|
||||
int
|
||||
rl_vi_goto_mark (count, key)
|
||||
int count, key;
|
||||
rl_vi_goto_mark (int count __attribute__((unused)), int key __attribute__((unused)))
|
||||
{
|
||||
int ch;
|
||||
|
||||
|
@@ -243,20 +243,20 @@ bdb_version_ok=yes
|
||||
])
|
||||
|
||||
AC_DEFUN([MYSQL_TOP_BUILDDIR], [
|
||||
# Remove trailing "./" if any
|
||||
[$1]=`echo $[$1] | sed -e 's,^\./,,'`
|
||||
case "$[$1]" in
|
||||
/* ) ;; # don't do anything with an absolute path
|
||||
"$srcdir"/* )
|
||||
"bdb" | "$srcdir/bdb" | "$top_srcdir/bdb" | "$abs_top_srcdir/bdb" )
|
||||
# If BDB is under the source directory, we need to look under the
|
||||
# build directory for bdb/build_unix.
|
||||
# NOTE: I'm being lazy, and assuming the user did not specify
|
||||
# something like --with-berkeley-db=bdb (it would be missing "./").
|
||||
[$1]="\$(top_builddir)/"`echo "$[$1]" | sed -e "s,^$srcdir/,,"`
|
||||
[$1]="\$(top_builddir)/bdb"
|
||||
;;
|
||||
/* ) ;; # Other absolute path is assume to be external BDB directory
|
||||
* )
|
||||
AC_MSG_ERROR([The BDB directory must be directly under the MySQL source directory, or be specified using the full path. ('$srcdir'; '$[$1]')])
|
||||
;;
|
||||
esac
|
||||
if test X"$[$1]" != "/"
|
||||
if test X"$[$1]" != X"/"
|
||||
then
|
||||
[$1]=`echo $[$1] | sed -e 's,/$,,'`
|
||||
fi
|
||||
|
@@ -20,7 +20,7 @@ AC_DEFUN([MYSQL_CHECK_INNODB], [
|
||||
AC_MSG_RESULT([Using Innodb])
|
||||
AC_DEFINE([HAVE_INNOBASE_DB], [1], [Using Innobase DB])
|
||||
have_innodb="yes"
|
||||
innodb_includes="-I../innobase/include"
|
||||
innodb_includes="-I\$(top_builddir)/innobase/include -I\$(top_srcdir)/innobase/include"
|
||||
innodb_system_libs=""
|
||||
dnl Some libs are listed several times, in order for gcc to sort out
|
||||
dnl circular references.
|
||||
|
@@ -140,7 +140,7 @@ AC_DEFUN([MYSQL_CHECK_NDBCLUSTER], [
|
||||
AC_MSG_RESULT([Using NDB Cluster])
|
||||
AC_DEFINE([HAVE_NDBCLUSTER_DB], [1], [Using Ndb Cluster DB])
|
||||
have_ndbcluster="yes"
|
||||
ndbcluster_includes="-I../ndb/include -I../ndb/include/ndbapi -I../ndb/include/mgmapi"
|
||||
ndbcluster_includes="-I\$(top_builddir)/ndb/include -I\$(top_srcdir)/ndb/include -I\$(top_srcdir)/ndb/include/ndbapi -I\$(top_srcdir)/ndb/include/mgmapi"
|
||||
ndbcluster_libs="\$(top_builddir)/ndb/src/.libs/libndbclient.a"
|
||||
ndbcluster_system_libs=""
|
||||
ndb_mgmclient_libs="\$(top_builddir)/ndb/src/mgmclient/libndbmgmclient.la"
|
||||
|
@@ -169,7 +169,7 @@ register unsigned long *child_time;
|
||||
*name_pos = temp->pos;
|
||||
*time_entered = temp->time;
|
||||
*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--;
|
||||
}
|
||||
DBUG_RETURN (rtnval);
|
||||
@@ -334,12 +334,12 @@ FILE *inf;
|
||||
* function is found on the stack.
|
||||
*/
|
||||
while (pop (&oldpos, &oldtime, &oldchild)) {
|
||||
DBUG_PRINT ("popped", ("%d %d", oldtime, oldchild));
|
||||
DBUG_PRINT ("popped", ("%lu %lu", oldtime, oldchild));
|
||||
time = fn_time - oldtime;
|
||||
t = top ();
|
||||
t -> children += time;
|
||||
DBUG_PRINT ("update", ("%s", modules[t -> pos].name));
|
||||
DBUG_PRINT ("update", ("%d", t -> children));
|
||||
DBUG_PRINT ("update", ("%lu", t -> children));
|
||||
time -= oldchild;
|
||||
modules[oldpos].m_time += time;
|
||||
modules[oldpos].m_calls++;
|
||||
@@ -520,19 +520,19 @@ register unsigned long int *s_calls, *s_time;
|
||||
unsigned long int calls, time;
|
||||
|
||||
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) {
|
||||
DBUG_PRINT ("out_body", ("%d,%d",*s_calls,*s_time));
|
||||
DBUG_PRINT ("out_body", ("%lu,%lu",*s_calls,*s_time));
|
||||
} else {
|
||||
while (root != MAXPROCS) {
|
||||
out_body (outf, s_table[root].lchild,s_calls,s_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_time += time;
|
||||
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;
|
||||
}
|
||||
|
@@ -1,4 +1,4 @@
|
||||
INCLUDES = -I../include -I../taocrypt/include -I../taocrypt/mySTL
|
||||
INCLUDES = -I$(srcdir)/../include -I$(srcdir)/../taocrypt/include -I$(srcdir)/../taocrypt/mySTL
|
||||
|
||||
noinst_LTLIBRARIES = libyassl.la
|
||||
libyassl_la_SOURCES = buffer.cpp cert_wrapper.cpp crypto_wrapper.cpp \
|
||||
|
@@ -918,7 +918,7 @@ void ERR_print_errors_fp(FILE* /*fp*/)
|
||||
|
||||
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) {
|
||||
SetErrorString(YasslError(errNumber), buffer);
|
||||
|
@@ -1,4 +1,4 @@
|
||||
INCLUDES = -I../include -I../mySTL
|
||||
INCLUDES = -I$(srcdir)/../include -I$(srcdir)/../mySTL
|
||||
bin_PROGRAMS = benchmark
|
||||
benchmark_SOURCES = benchmark.cpp
|
||||
benchmark_LDADD = $(top_builddir)/extra/yassl/taocrypt/src/libtaocrypt.la
|
||||
|
@@ -42,7 +42,7 @@ RSC=rc.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\include" /I "..\..\mySTL" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /GX /O2 /I "..\include" /I "..\mySTL" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
@@ -65,7 +65,7 @@ LINK32=link.exe
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\include" /I "..\..\mySTL" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "..\include" /I "..\mySTL" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
|
@@ -1,4 +1,4 @@
|
||||
INCLUDES = -I../include -I../mySTL
|
||||
INCLUDES = -I$(srcdir)/../include -I$(srcdir)/../mySTL
|
||||
|
||||
noinst_LTLIBRARIES = libtaocrypt.la
|
||||
|
||||
|
@@ -41,7 +41,7 @@ RSC=rc.exe
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
|
||||
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "include" /I "..\mySTL" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
|
||||
# ADD CPP /nologo /G6 /MT /W3 /O2 /I "include" /I "mySTL" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
@@ -64,7 +64,7 @@ LIB32=link.exe -lib
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /ZI /Od /I "include" /I "..\mySTL" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /ZI /Od /I "include" /I "mySTL" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /YX /FD /GZ /c
|
||||
# SUBTRACT CPP /Fr
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
|
@@ -21,7 +21,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="include,..\mySTL"
|
||||
AdditionalIncludeDirectories="include,mySTL"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB"
|
||||
ExceptionHandling="FALSE"
|
||||
BasicRuntimeChecks="3"
|
||||
@@ -75,7 +75,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="include,..\mySTL"
|
||||
AdditionalIncludeDirectories="include,mySTL"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB"
|
||||
StringPooling="TRUE"
|
||||
ExceptionHandling="FALSE"
|
||||
|
@@ -42,7 +42,7 @@ RSC=rc.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /O2 /I "include" /I "../mySTL" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /O2 /I "include" /I "mySTL" /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
@@ -66,7 +66,7 @@ LINK32=link.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /ZI /Od /I "include" /I "../mySTL" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /ZI /Od /I "include" /I "mySTL" /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /FR /YX /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
|
@@ -1,4 +1,4 @@
|
||||
INCLUDES = -I../include -I../mySTL
|
||||
INCLUDES = -I$(srcdir)/../include -I$(srcdir)/../mySTL
|
||||
bin_PROGRAMS = test
|
||||
test_SOURCES = test.cpp
|
||||
test_LDADD = $(top_builddir)/extra/yassl/taocrypt/src/libtaocrypt.la
|
||||
|
@@ -1,4 +1,4 @@
|
||||
INCLUDES = -I../include -I../taocrypt/include -I../taocrypt/mySTL
|
||||
INCLUDES = -I$(srcdir)/../include -I$(srcdir)/../taocrypt/include -I$(srcdir)/../taocrypt/mySTL
|
||||
bin_PROGRAMS = testsuite
|
||||
testsuite_SOURCES = testsuite.cpp ../taocrypt/test/test.cpp \
|
||||
../examples/client/client.cpp ../examples/server/server.cpp \
|
||||
|
@@ -86,8 +86,8 @@ int main(int argc, char** argv)
|
||||
// input output compare
|
||||
byte input[TaoCrypt::MD5::DIGEST_SIZE];
|
||||
byte output[TaoCrypt::MD5::DIGEST_SIZE];
|
||||
file_test("input", input);
|
||||
file_test("output", output);
|
||||
file_test((char*) "input", input);
|
||||
file_test((char*) "output", output);
|
||||
assert(memcmp(input, output, sizeof(input)) == 0);
|
||||
|
||||
printf("\nAll tests passed!\n");
|
||||
|
@@ -42,7 +42,7 @@ RSC=rc.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /O2 /I "../taocrypt/include" /I "../include" /I "../mySTL" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "NO_MAIN_DRIVER" /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /O2 /I "../taocrypt/include" /I "../include" /I "../taocrypt/mySTL" /D "NDEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "NO_MAIN_DRIVER" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
@@ -67,7 +67,7 @@ LINK32=link.exe
|
||||
# PROP Ignore_Export_Lib 0
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /D "_MBCS" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /ZI /Od /I "../taocrypt/include" /I "../include" /I "../mySTL" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "NO_MAIN_DRIVER" /FR /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /ZI /Od /I "../taocrypt/include" /I "../include" /I "../taocrypt/mySTL" /D "_DEBUG" /D "WIN32" /D "_CONSOLE" /D "_MBCS" /D "NO_MAIN_DRIVER" /FR /YX /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
|
@@ -41,7 +41,7 @@ RSC=rc.exe
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "YASSL_PREFIX" /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /O2 /I "include" /I "taocrypt\include" /I "mySTL" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "YASSL_PREFIX" /YX /FD /c
|
||||
# ADD CPP /nologo /MT /W3 /O2 /I "include" /I "taocrypt\include" /I "taocrypt\mySTL" /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_LIB" /D "YASSL_PREFIX" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409 /d "NDEBUG"
|
||||
# ADD RSC /l 0x409 /d "NDEBUG"
|
||||
BSC32=bscmake.exe
|
||||
@@ -64,7 +64,7 @@ LIB32=link.exe -lib
|
||||
# PROP Intermediate_Dir "Debug"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "YASSL_PREFIX" /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /ZI /Od /I "include" /I "taocrypt\include" /I "mySTL" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "YASSL_PREFIX" /FR /YX /FD /GZ /c
|
||||
# ADD CPP /nologo /MTd /W3 /Gm /ZI /Od /I "include" /I "taocrypt\include" /I "taocrypt\mySTL" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "_LIB" /D "YASSL_PREFIX" /FR /YX /FD /GZ /c
|
||||
# ADD BASE RSC /l 0x409 /d "_DEBUG"
|
||||
# ADD RSC /l 0x409 /d "_DEBUG"
|
||||
BSC32=bscmake.exe
|
||||
|
@@ -21,7 +21,7 @@
|
||||
<Tool
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="0"
|
||||
AdditionalIncludeDirectories="include,taocrypt\include,mySTL"
|
||||
AdditionalIncludeDirectories="include,taocrypt\include,taocrypt\mySTL"
|
||||
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;YASSL_PREFIX"
|
||||
ExceptionHandling="FALSE"
|
||||
BasicRuntimeChecks="3"
|
||||
@@ -75,7 +75,7 @@
|
||||
Name="VCCLCompilerTool"
|
||||
Optimization="2"
|
||||
InlineFunctionExpansion="1"
|
||||
AdditionalIncludeDirectories="include,taocrypt\include,mySTL"
|
||||
AdditionalIncludeDirectories="include,taocrypt\include,taocrypt\mySTL"
|
||||
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;YASSL_PREFIX"
|
||||
StringPooling="TRUE"
|
||||
ExceptionHandling="FALSE"
|
||||
|
@@ -88,7 +88,8 @@ int heap_check_heap(HP_INFO *info, my_bool print_status)
|
||||
if (records != share->records || deleted != share->deleted)
|
||||
{
|
||||
DBUG_PRINT("error",("Found rows: %lu (%lu) deleted %lu (%lu)",
|
||||
records, share->records, deleted, share->deleted));
|
||||
records, (ulong) share->records,
|
||||
deleted, (ulong) share->deleted));
|
||||
error= 1;
|
||||
}
|
||||
*info= save_info;
|
||||
@@ -100,9 +101,9 @@ static int check_one_key(HP_KEYDEF *keydef, uint keynr, ulong records,
|
||||
ulong blength, my_bool print_status)
|
||||
{
|
||||
int error;
|
||||
uint i,found,max_links,seek,links;
|
||||
uint rec_link; /* Only used with debugging */
|
||||
uint hash_buckets_found;
|
||||
ulong i,found,max_links,seek,links;
|
||||
ulong rec_link; /* Only used with debugging */
|
||||
ulong hash_buckets_found;
|
||||
HASH_INFO *hash_info;
|
||||
|
||||
error=0;
|
||||
@@ -123,7 +124,9 @@ static int check_one_key(HP_KEYDEF *keydef, uint keynr, ulong records,
|
||||
blength, records))
|
||||
!= i)
|
||||
{
|
||||
DBUG_PRINT("error",("Record in wrong link: Link %d Record: 0x%lx Record-link %d", i,hash_info->ptr_to_rec,rec_link));
|
||||
DBUG_PRINT("error",
|
||||
("Record in wrong link: Link %lu Record: 0x%lx Record-link %lu",
|
||||
i, (long) hash_info->ptr_to_rec, rec_link));
|
||||
error=1;
|
||||
}
|
||||
else
|
||||
@@ -141,18 +144,18 @@ static int check_one_key(HP_KEYDEF *keydef, uint keynr, ulong records,
|
||||
if (keydef->hash_buckets != hash_buckets_found)
|
||||
{
|
||||
DBUG_PRINT("error",("Found %ld buckets, stats shows %ld buckets",
|
||||
hash_buckets_found, keydef->hash_buckets));
|
||||
hash_buckets_found, (long) keydef->hash_buckets));
|
||||
error=1;
|
||||
}
|
||||
DBUG_PRINT("info",
|
||||
("records: %ld seeks: %d max links: %d hitrate: %.2f "
|
||||
"buckets: %d",
|
||||
("records: %ld seeks: %lu max links: %lu hitrate: %.2f "
|
||||
"buckets: %lu",
|
||||
records,seek,max_links,
|
||||
(float) seek / (float) (records ? records : 1),
|
||||
hash_buckets_found));
|
||||
if (print_status)
|
||||
printf("Key: %d records: %ld seeks: %d max links: %d "
|
||||
"hitrate: %.2f buckets: %d\n",
|
||||
printf("Key: %d records: %ld seeks: %lu max links: %lu "
|
||||
"hitrate: %.2f buckets: %lu\n",
|
||||
keynr, records, seek, max_links,
|
||||
(float) seek / (float) (records ? records : 1),
|
||||
hash_buckets_found);
|
||||
@@ -180,8 +183,8 @@ static int check_one_rb_key(HP_INFO *info, uint keynr, ulong records,
|
||||
key_length, SEARCH_FIND | SEARCH_SAME, not_used))
|
||||
{
|
||||
error= 1;
|
||||
DBUG_PRINT("error",("Record in wrong link: key: %d Record: 0x%lx\n",
|
||||
keynr, recpos));
|
||||
DBUG_PRINT("error",("Record in wrong link: key: %u Record: 0x%lx\n",
|
||||
keynr, (long) recpos));
|
||||
}
|
||||
else
|
||||
found++;
|
||||
|
@@ -24,7 +24,7 @@ int heap_delete(HP_INFO *info, const byte *record)
|
||||
HP_SHARE *share=info->s;
|
||||
HP_KEYDEF *keydef, *end, *p_lastinx;
|
||||
DBUG_ENTER("heap_delete");
|
||||
DBUG_PRINT("enter",("info: %lx record: 0x%lx",info,record));
|
||||
DBUG_PRINT("enter",("info: 0x%lx record: 0x%lx", (long) info, (long) record));
|
||||
|
||||
test_active(info);
|
||||
|
||||
@@ -144,7 +144,7 @@ int hp_delete_key(HP_INFO *info, register HP_KEYDEF *keyinfo,
|
||||
info->current_hash_ptr=last_ptr;
|
||||
info->current_ptr = last_ptr ? last_ptr->ptr_to_rec : 0;
|
||||
DBUG_PRINT("info",("Corrected current_ptr to point at: 0x%lx",
|
||||
info->current_ptr));
|
||||
(long) info->current_ptr));
|
||||
}
|
||||
empty=pos;
|
||||
if (gpos)
|
||||
|
@@ -120,7 +120,7 @@ byte *hp_search(HP_INFO *info, HP_KEYDEF *keyinfo, const byte *key,
|
||||
{
|
||||
switch (nextflag) {
|
||||
case 0: /* Search after key */
|
||||
DBUG_PRINT("exit",("found key at %d",pos->ptr_to_rec));
|
||||
DBUG_PRINT("exit", ("found key at 0x%lx", (long) pos->ptr_to_rec));
|
||||
info->current_hash_ptr=pos;
|
||||
DBUG_RETURN(info->current_ptr= pos->ptr_to_rec);
|
||||
case 1: /* Search next */
|
||||
|
@@ -64,7 +64,8 @@ HP_INFO *heap_open(const char *name, int mode)
|
||||
info->opt_flag= READ_CHECK_USED; /* Check when changing */
|
||||
#endif
|
||||
DBUG_PRINT("exit",("heap: 0x%lx reclength: %d records_in_block: %d",
|
||||
info,share->reclength,share->block.records_in_block));
|
||||
(long) info, share->reclength,
|
||||
share->block.records_in_block));
|
||||
DBUG_RETURN(info);
|
||||
}
|
||||
|
||||
@@ -82,7 +83,7 @@ HP_SHARE *hp_find_named_heap(const char *name)
|
||||
info= (HP_SHARE*) pos->data;
|
||||
if (!strcmp(name, info->name))
|
||||
{
|
||||
DBUG_PRINT("exit", ("Old heap_database: 0x%lx",info));
|
||||
DBUG_PRINT("exit", ("Old heap_database: 0x%lx", (long) info));
|
||||
DBUG_RETURN(info);
|
||||
}
|
||||
}
|
||||
|
@@ -23,7 +23,7 @@ int heap_rkey(HP_INFO *info, byte *record, int inx, const byte *key,
|
||||
HP_SHARE *share= info->s;
|
||||
HP_KEYDEF *keyinfo= share->keydef + inx;
|
||||
DBUG_ENTER("heap_rkey");
|
||||
DBUG_PRINT("enter",("base: 0x%lx inx: %d",info,inx));
|
||||
DBUG_PRINT("enter",("info: 0x%lx inx: %d", (long) info, inx));
|
||||
|
||||
if ((uint) inx >= share->keys)
|
||||
{
|
||||
|
@@ -29,7 +29,7 @@ int heap_rrnd(register HP_INFO *info, byte *record, byte *pos)
|
||||
{
|
||||
HP_SHARE *share=info->s;
|
||||
DBUG_ENTER("heap_rrnd");
|
||||
DBUG_PRINT("enter",("info: 0x%lx pos: %lx",info,pos));
|
||||
DBUG_PRINT("enter",("info: 0x%lx pos: %lx",(long) info, (long) pos));
|
||||
|
||||
info->lastinx= -1;
|
||||
if (!(info->current_ptr= pos))
|
||||
@@ -44,7 +44,7 @@ int heap_rrnd(register HP_INFO *info, byte *record, byte *pos)
|
||||
}
|
||||
info->update=HA_STATE_PREV_FOUND | HA_STATE_NEXT_FOUND | HA_STATE_AKTIV;
|
||||
memcpy(record,info->current_ptr,(size_t) share->reclength);
|
||||
DBUG_PRINT("exit",("found record at 0x%lx",info->current_ptr));
|
||||
DBUG_PRINT("exit", ("found record at 0x%lx", (long) info->current_ptr));
|
||||
info->current_hash_ptr=0; /* Can't use rnext */
|
||||
DBUG_RETURN(0);
|
||||
} /* heap_rrnd */
|
||||
|
@@ -138,7 +138,7 @@ static byte *next_free_record_pos(HP_SHARE *info)
|
||||
pos=info->del_link;
|
||||
info->del_link= *((byte**) pos);
|
||||
info->deleted--;
|
||||
DBUG_PRINT("exit",("Used old position: 0x%lx",pos));
|
||||
DBUG_PRINT("exit",("Used old position: 0x%lx",(long) pos));
|
||||
DBUG_RETURN(pos);
|
||||
}
|
||||
if (!(block_pos=(info->records % info->block.records_in_block)))
|
||||
@@ -153,9 +153,9 @@ static byte *next_free_record_pos(HP_SHARE *info)
|
||||
DBUG_RETURN(NULL);
|
||||
info->data_length+=length;
|
||||
}
|
||||
DBUG_PRINT("exit",("Used new position: %lx",
|
||||
(byte*) info->block.level_info[0].last_blocks+block_pos*
|
||||
info->block.recbuffer));
|
||||
DBUG_PRINT("exit",("Used new position: 0x%lx",
|
||||
(long) ((byte*) info->block.level_info[0].last_blocks+
|
||||
block_pos * info->block.recbuffer)));
|
||||
DBUG_RETURN((byte*) info->block.level_info[0].last_blocks+
|
||||
block_pos*info->block.recbuffer);
|
||||
}
|
||||
|
@@ -97,6 +97,7 @@ extern const char *client_errors[]; /* Error messages */
|
||||
#define CR_NO_STMT_METADATA 2052
|
||||
#define CR_NO_RESULT_SET 2053
|
||||
#define CR_NOT_IMPLEMENTED 2054
|
||||
#define CR_ERROR_LAST /*Copy last error nr:*/ 2054
|
||||
#define CR_SERVER_LOST_EXTENDED 2055
|
||||
#define CR_ERROR_LAST /*Copy last error nr:*/ 2055
|
||||
/* Add error numbers before CR_ERROR_LAST and change it accordingly. */
|
||||
|
||||
|
@@ -863,7 +863,12 @@ my_bool my_gethwaddr(uchar *to);
|
||||
#define HAVE_MMAP
|
||||
#endif
|
||||
|
||||
#ifndef __NETWARE__
|
||||
int my_getpagesize(void);
|
||||
#else
|
||||
#define my_getpagesize() 8192
|
||||
#endif
|
||||
|
||||
void *my_mmap(void *, size_t, int, int, int, my_off_t);
|
||||
int my_munmap(void *, size_t);
|
||||
#endif
|
||||
|
@@ -89,8 +89,8 @@ DEFS = -DDEFAULT_CHARSET_HOME="\"$(MYSQLBASEdir)\"" \
|
||||
-DSHAREDIR="\"$(MYSQLSHAREdir)\"" $(target_defs)
|
||||
|
||||
if HAVE_YASSL
|
||||
yassl_las = $(top_srcdir)/extra/yassl/src/libyassl.la \
|
||||
$(top_srcdir)/extra/yassl/taocrypt/src/libtaocrypt.la
|
||||
yassl_las = $(top_builddir)/extra/yassl/src/libyassl.la \
|
||||
$(top_builddir)/extra/yassl/taocrypt/src/libtaocrypt.la
|
||||
endif
|
||||
|
||||
# The automatic dependencies miss this
|
||||
|
@@ -82,6 +82,7 @@ const char *client_errors[]=
|
||||
"Prepared statement contains no metadata",
|
||||
"Attempt to read a row while there is no result set associated with the statement",
|
||||
"This feature is not implemented yet",
|
||||
"Lost connection to MySQL server at '%s', system error: %d",
|
||||
""
|
||||
};
|
||||
|
||||
@@ -145,6 +146,7 @@ const char *client_errors[]=
|
||||
"Prepared statement contains no metadata",
|
||||
"Attempt to read a row while there is no result set associated with the statement",
|
||||
"This feature is not implemented yet",
|
||||
"Lost connection to MySQL server at '%s', system error: %d",
|
||||
""
|
||||
};
|
||||
|
||||
@@ -206,6 +208,7 @@ const char *client_errors[]=
|
||||
"Prepared statement contains no metadata",
|
||||
"Attempt to read a row while there is no result set associated with the statement",
|
||||
"This feature is not implemented yet",
|
||||
"Lost connection to MySQL server at '%s', system error: %d",
|
||||
""
|
||||
};
|
||||
#endif
|
||||
|
@@ -2100,7 +2100,7 @@ mysql_stmt_prepare(MYSQL_STMT *stmt, const char *query, ulong length)
|
||||
}
|
||||
stmt->bind= stmt->params + stmt->param_count;
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -2443,10 +2443,10 @@ static my_bool store_param(MYSQL_STMT *stmt, MYSQL_BIND *param)
|
||||
{
|
||||
NET *net= &stmt->mysql->net;
|
||||
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 ? param->buffer : "0", *param->length,
|
||||
*param->is_null));
|
||||
(long) (param->buffer ? param->buffer : NullS),
|
||||
*param->length, *param->is_null));
|
||||
|
||||
if (*param->is_null)
|
||||
store_param_null(net, param);
|
||||
@@ -3325,8 +3325,8 @@ mysql_stmt_send_long_data(MYSQL_STMT *stmt, uint param_number,
|
||||
MYSQL_BIND *param;
|
||||
DBUG_ENTER("mysql_stmt_send_long_data");
|
||||
DBUG_ASSERT(stmt != 0);
|
||||
DBUG_PRINT("enter",("param no : %d, data : %lx, length : %ld",
|
||||
param_number, data, length));
|
||||
DBUG_PRINT("enter",("param no: %d data: 0x%lx, length : %ld",
|
||||
param_number, (long) data, length));
|
||||
|
||||
/*
|
||||
We only need to check for stmt->param_count, if it's not null
|
||||
@@ -4409,7 +4409,7 @@ my_bool STDCALL mysql_stmt_bind_result(MYSQL_STMT *stmt, MYSQL_BIND *bind)
|
||||
ulong bind_count= stmt->field_count;
|
||||
uint param_count= 0;
|
||||
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)
|
||||
{
|
||||
|
@@ -29,8 +29,6 @@ INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include \
|
||||
## automake barfs if you don't use $(srcdir) or $(top_srcdir) in include
|
||||
include $(top_srcdir)/libmysql/Makefile.shared
|
||||
|
||||
libmysql_dir = $(top_srcdir)/libmysql
|
||||
|
||||
libmysqlclient_r_la_SOURCES = $(target_sources)
|
||||
libmysqlclient_r_la_LIBADD = $(target_libadd) $(yassl_las)
|
||||
libmysqlclient_r_la_LDFLAGS = $(target_ldflags)
|
||||
@@ -38,7 +36,9 @@ libmysqlclient_r_la_LDFLAGS = $(target_ldflags)
|
||||
# This is called from the toplevel makefile
|
||||
link_sources:
|
||||
set -x; \
|
||||
for f in `cd $(libmysql_dir) && echo *.[ch]`; do \
|
||||
rm -f $$f; \
|
||||
@LN_CP_F@ $(libmysql_dir)/$$f $$f; \
|
||||
for d in $(top_srcdir)/libmysql $(top_builddir)/libmysql; do \
|
||||
for f in `cd $$d && echo *.[ch]`; do \
|
||||
rm -f $$f; \
|
||||
@LN_CP_F@ $$d/$$f $$f; \
|
||||
done; \
|
||||
done
|
||||
|
@@ -25,9 +25,10 @@ DEFS = -DEMBEDDED_LIBRARY -DMYSQL_SERVER \
|
||||
-DDEFAULT_MYSQL_HOME="\"$(MYSQLBASEdir)\"" \
|
||||
-DDATADIR="\"$(MYSQLDATAdir)\"" \
|
||||
-DSHAREDIR="\"$(MYSQLSHAREdir)\""
|
||||
INCLUDES= @bdb_includes@ \
|
||||
INCLUDES= @bdb_includes@ @innodb_includes@ @ndbcluster_includes@ \
|
||||
-I$(top_builddir)/include -I$(top_srcdir)/include \
|
||||
-I$(top_srcdir)/sql -I$(top_srcdir)/sql/examples \
|
||||
-I$(top_builddir)/sql -I$(top_srcdir)/sql \
|
||||
-I$(top_srcdir)/sql/examples \
|
||||
-I$(top_srcdir)/regex \
|
||||
$(openssl_includes) @ZLIB_INCLUDES@
|
||||
|
||||
@@ -118,16 +119,28 @@ endif
|
||||
#libmysqld_la_LDFLAGS = -version-info @SHARED_LIB_VERSION@
|
||||
#CLEANFILES = $(libmysqld_la_LIBADD) libmysqld.la
|
||||
|
||||
# This is called from the toplevel makefile
|
||||
# This is called from the toplevel makefile. If we can link now
|
||||
# to an existing file in source, we do that, else we assume it
|
||||
# will show up in the build tree eventually (generated file).
|
||||
link_sources:
|
||||
set -x; \
|
||||
for f in $(sqlsources); do \
|
||||
rm -f $$f; \
|
||||
@LN_CP_F@ $(top_srcdir)/sql/$$f $$f; \
|
||||
if test -e $(top_srcdir)/sql/$$f ; \
|
||||
then \
|
||||
@LN_CP_F@ $(top_srcdir)/sql/$$f $$f; \
|
||||
else \
|
||||
@LN_CP_F@ $(top_builddir)/sql/$$f $$f; \
|
||||
fi ; \
|
||||
done; \
|
||||
for f in $(libmysqlsources); do \
|
||||
rm -f $$f; \
|
||||
@LN_CP_F@ $(top_srcdir)/libmysql/$$f $$f; \
|
||||
if test -e $(top_srcdir)/libmysql/$$f ; \
|
||||
then \
|
||||
@LN_CP_F@ $(top_srcdir)/libmysql/$$f $$f; \
|
||||
else \
|
||||
@LN_CP_F@ $(top_builddir)/libmysql/$$f $$f; \
|
||||
fi ; \
|
||||
done; \
|
||||
for f in $(sqlexamplessources); do \
|
||||
rm -f $$f; \
|
||||
|
@@ -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);
|
||||
|
||||
error:
|
||||
|
@@ -28,8 +28,9 @@ int mi_close(register MI_INFO *info)
|
||||
int error=0,flag;
|
||||
MYISAM_SHARE *share=info->s;
|
||||
DBUG_ENTER("mi_close");
|
||||
DBUG_PRINT("enter",("base: %lx reopen: %u locks: %u",
|
||||
info,(uint) share->reopen, (uint) share->tot_locks));
|
||||
DBUG_PRINT("enter",("base: 0x%lx reopen: %u locks: %u",
|
||||
(long) info, (uint) share->reopen,
|
||||
(uint) share->tot_locks));
|
||||
|
||||
pthread_mutex_lock(&THR_LOCK_myisam);
|
||||
if (info->lock_type == F_EXTRA_LCK)
|
||||
|
@@ -165,7 +165,7 @@ static int _mi_ck_real_delete(register MI_INFO *info, MI_KEYDEF *keyinfo,
|
||||
DBUG_PRINT("error",("Couldn't allocate memory"));
|
||||
DBUG_RETURN(my_errno=ENOMEM);
|
||||
}
|
||||
DBUG_PRINT("info",("root_page: %ld",old_root));
|
||||
DBUG_PRINT("info",("root_page: %ld", (long) old_root));
|
||||
if (!_mi_fetch_keypage(info,keyinfo,old_root,DFLT_INIT_HITS,root_buff,0))
|
||||
{
|
||||
error= -1;
|
||||
@@ -410,7 +410,7 @@ static int del(register MI_INFO *info, register MI_KEYDEF *keyinfo, uchar *key,
|
||||
MYISAM_SHARE *share=info->s;
|
||||
MI_KEY_PARAM s_temp;
|
||||
DBUG_ENTER("del");
|
||||
DBUG_PRINT("enter",("leaf_page: %ld keypos: 0x%lx", leaf_page,
|
||||
DBUG_PRINT("enter",("leaf_page: %ld keypos: 0x%lx", (long) leaf_page,
|
||||
(ulong) keypos));
|
||||
DBUG_DUMP("leaf_buff",(byte*) leaf_buff,mi_getint(leaf_buff));
|
||||
|
||||
@@ -597,7 +597,8 @@ static int underflow(register MI_INFO *info, register MI_KEYDEF *keyinfo,
|
||||
else
|
||||
{ /* Page is full */
|
||||
endpos=anc_buff+anc_length;
|
||||
DBUG_PRINT("test",("anc_buff: %lx endpos: %lx",anc_buff,endpos));
|
||||
DBUG_PRINT("test",("anc_buff: 0x%lx endpos: 0x%lx",
|
||||
(long) anc_buff, (long) endpos));
|
||||
if (keypos != anc_buff+2+key_reflength &&
|
||||
!_mi_get_last_key(info,keyinfo,anc_buff,anc_key,keypos,&length))
|
||||
goto err;
|
||||
@@ -775,7 +776,7 @@ static uint remove_key(MI_KEYDEF *keyinfo, uint nod_flag,
|
||||
int s_length;
|
||||
uchar *start;
|
||||
DBUG_ENTER("remove_key");
|
||||
DBUG_PRINT("enter",("keypos: %lx page_end: %lx",keypos,page_end));
|
||||
DBUG_PRINT("enter",("keypos: 0x%lx page_end: 0x%lx",(long) keypos, (long) page_end));
|
||||
|
||||
start=keypos;
|
||||
if (!(keyinfo->flag &
|
||||
|
@@ -1066,8 +1066,8 @@ ulong _mi_rec_unpack(register MI_INFO *info, register byte *to, byte *from,
|
||||
|
||||
err:
|
||||
my_errno= HA_ERR_WRONG_IN_RECORD;
|
||||
DBUG_PRINT("error",("to_end: %lx -> %lx from_end: %lx -> %lx",
|
||||
to,to_end,from,from_end));
|
||||
DBUG_PRINT("error",("to_end: 0x%lx -> 0x%lx from_end: 0x%lx -> 0x%lx",
|
||||
(long) to, (long) to_end, (long) from, (long) from_end));
|
||||
DBUG_DUMP("from",(byte*) info->rec_buff,info->s->base.min_pack_length);
|
||||
DBUG_RETURN(MY_FILE_ERROR);
|
||||
} /* _mi_rec_unpack */
|
||||
|
@@ -54,8 +54,8 @@ int mi_assign_to_key_cache(MI_INFO *info,
|
||||
int error= 0;
|
||||
MYISAM_SHARE* share= info->s;
|
||||
DBUG_ENTER("mi_assign_to_key_cache");
|
||||
DBUG_PRINT("enter",("old_key_cache_handle: %lx new_key_cache_handle: %lx",
|
||||
share->key_cache, key_cache));
|
||||
DBUG_PRINT("enter",("old_key_cache_handle: 0x%lx new_key_cache_handle: 0x%lx",
|
||||
(long) share->key_cache, (long) key_cache));
|
||||
|
||||
/*
|
||||
Skip operation if we didn't change key cache. This can happen if we
|
||||
|
@@ -27,7 +27,7 @@ uchar *_mi_fetch_keypage(register MI_INFO *info, MI_KEYDEF *keyinfo,
|
||||
uchar *tmp;
|
||||
uint page_size;
|
||||
DBUG_ENTER("_mi_fetch_keypage");
|
||||
DBUG_PRINT("enter",("page: %ld",page));
|
||||
DBUG_PRINT("enter",("page: %ld", (long) page));
|
||||
|
||||
tmp=(uchar*) key_cache_read(info->s->key_cache,
|
||||
info->s->kfile, page, level, (byte*) buff,
|
||||
@@ -80,7 +80,7 @@ int _mi_write_keypage(register MI_INFO *info, register MI_KEYDEF *keyinfo,
|
||||
my_errno=EINVAL;
|
||||
DBUG_RETURN((-1));
|
||||
}
|
||||
DBUG_PRINT("page",("write page at: %lu",(long) page,buff));
|
||||
DBUG_PRINT("page",("write page at: %lu",(long) page));
|
||||
DBUG_DUMP("buff",(byte*) buff,mi_getint(buff));
|
||||
#endif
|
||||
|
||||
|
@@ -255,8 +255,8 @@ int _mi_read_rnd_static_record(MI_INFO *info, byte *buf,
|
||||
if (filepos >= info->state->data_file_length)
|
||||
{
|
||||
DBUG_PRINT("test",("filepos: %ld (%ld) records: %ld del: %ld",
|
||||
filepos/share->base.reclength,filepos,
|
||||
info->state->records, info->state->del));
|
||||
(long) filepos/share->base.reclength, (long) filepos,
|
||||
(long) info->state->records, (long) info->state->del));
|
||||
fast_mi_writeinfo(info);
|
||||
DBUG_RETURN(my_errno=HA_ERR_END_OF_FILE);
|
||||
}
|
||||
|
@@ -813,7 +813,7 @@ end:
|
||||
printf("Write records: %d\nUpdate records: %d\nSame-key-read: %d\nDelete records: %d\n", write_count,update,dupp_keys,opt_delete);
|
||||
if (rec_pointer_size)
|
||||
printf("Record pointer size: %d\n",rec_pointer_size);
|
||||
printf("myisam_block_size: %u\n", myisam_block_size);
|
||||
printf("myisam_block_size: %lu\n", myisam_block_size);
|
||||
if (key_cacheing)
|
||||
{
|
||||
puts("Key cache used");
|
||||
|
@@ -339,7 +339,7 @@ static int w_search(register MI_INFO *info, register MI_KEYDEF *keyinfo,
|
||||
my_bool was_last_key;
|
||||
my_off_t next_page, dupp_key_pos;
|
||||
DBUG_ENTER("w_search");
|
||||
DBUG_PRINT("enter",("page: %ld",page));
|
||||
DBUG_PRINT("enter",("page: %ld", (long) page));
|
||||
|
||||
search_key_length= (comp_flag & SEARCH_FIND) ? key_length : USE_WHOLE_KEY;
|
||||
if (!(temp_buff= (uchar*) my_alloca((uint) keyinfo->block_length+
|
||||
@@ -462,7 +462,7 @@ int _mi_insert(register MI_INFO *info, register MI_KEYDEF *keyinfo,
|
||||
uchar *endpos, *prev_key;
|
||||
MI_KEY_PARAM s_temp;
|
||||
DBUG_ENTER("_mi_insert");
|
||||
DBUG_PRINT("enter",("key_pos: %lx",key_pos));
|
||||
DBUG_PRINT("enter",("key_pos: 0x%lx", (long) key_pos));
|
||||
DBUG_EXECUTE("key",_mi_print_key(DBUG_FILE,keyinfo->seg,key,USE_WHOLE_KEY););
|
||||
|
||||
nod_flag=mi_test_if_nod(anc_buff);
|
||||
@@ -483,8 +483,8 @@ int _mi_insert(register MI_INFO *info, register MI_KEYDEF *keyinfo,
|
||||
{
|
||||
DBUG_PRINT("test",("t_length: %d ref_len: %d",
|
||||
t_length,s_temp.ref_length));
|
||||
DBUG_PRINT("test",("n_ref_len: %d n_length: %d key_pos: %lx",
|
||||
s_temp.n_ref_length,s_temp.n_length,s_temp.key));
|
||||
DBUG_PRINT("test",("n_ref_len: %d n_length: %d key_pos: 0x%lx",
|
||||
s_temp.n_ref_length,s_temp.n_length, (long) s_temp.key));
|
||||
}
|
||||
#endif
|
||||
if (t_length > 0)
|
||||
@@ -677,7 +677,8 @@ uchar *_mi_find_half_pos(uint nod_flag, MI_KEYDEF *keyinfo, uchar *page,
|
||||
} while (page < end);
|
||||
*return_key_length=length;
|
||||
*after_key=page;
|
||||
DBUG_PRINT("exit",("returns: %lx page: %lx half: %lx",lastpos,page,end));
|
||||
DBUG_PRINT("exit",("returns: 0x%lx page: 0x%lx half: 0x%lx",
|
||||
(long) lastpos, (long) page, (long) end));
|
||||
DBUG_RETURN(lastpos);
|
||||
} /* _mi_find_half_pos */
|
||||
|
||||
@@ -732,7 +733,8 @@ static uchar *_mi_find_last_pos(MI_KEYDEF *keyinfo, uchar *page,
|
||||
}
|
||||
*return_key_length=last_length;
|
||||
*after_key=lastpos;
|
||||
DBUG_PRINT("exit",("returns: %lx page: %lx end: %lx",prevpos,page,end));
|
||||
DBUG_PRINT("exit",("returns: 0x%lx page: 0x%lx end: 0x%lx",
|
||||
(long) prevpos,(long) page,(long) end));
|
||||
DBUG_RETURN(prevpos);
|
||||
} /* _mi_find_last_pos */
|
||||
|
||||
@@ -768,7 +770,7 @@ static int _mi_balance_page(register MI_INFO *info, MI_KEYDEF *keyinfo,
|
||||
next_page= _mi_kpos(info->s->base.key_reflength,
|
||||
father_key_pos+father_keylength);
|
||||
buff=info->buff;
|
||||
DBUG_PRINT("test",("use right page: %lu",next_page));
|
||||
DBUG_PRINT("test",("use right page: %lu", (ulong) next_page));
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -777,7 +779,7 @@ static int _mi_balance_page(register MI_INFO *info, MI_KEYDEF *keyinfo,
|
||||
next_page= _mi_kpos(info->s->base.key_reflength,father_key_pos);
|
||||
/* Fix that curr_buff is to left */
|
||||
buff=curr_buff; curr_buff=info->buff;
|
||||
DBUG_PRINT("test",("use left page: %lu",next_page));
|
||||
DBUG_PRINT("test",("use left page: %lu", (ulong) next_page));
|
||||
} /* father_key_pos ptr to parting key */
|
||||
|
||||
if (!_mi_fetch_keypage(info,keyinfo,next_page,DFLT_INIT_HITS,info->buff,0))
|
||||
|
@@ -2036,7 +2036,7 @@ static void write_field_info(HUFF_COUNTS *counts, uint fields, uint trees)
|
||||
uint huff_tree_bits;
|
||||
huff_tree_bits=max_bit(trees ? trees-1 : 0);
|
||||
|
||||
DBUG_PRINT("info", (""));
|
||||
DBUG_PRINT("info", (" "));
|
||||
DBUG_PRINT("info", ("column types:"));
|
||||
DBUG_PRINT("info", ("FIELD_NORMAL 0"));
|
||||
DBUG_PRINT("info", ("FIELD_SKIP_ENDSPACE 1"));
|
||||
@@ -2048,12 +2048,12 @@ static void write_field_info(HUFF_COUNTS *counts, uint fields, uint trees)
|
||||
DBUG_PRINT("info", ("FIELD_ZERO 7"));
|
||||
DBUG_PRINT("info", ("FIELD_VARCHAR 8"));
|
||||
DBUG_PRINT("info", ("FIELD_CHECK 9"));
|
||||
DBUG_PRINT("info", (""));
|
||||
DBUG_PRINT("info", (" "));
|
||||
DBUG_PRINT("info", ("pack type as a set of flags:"));
|
||||
DBUG_PRINT("info", ("PACK_TYPE_SELECTED 1"));
|
||||
DBUG_PRINT("info", ("PACK_TYPE_SPACE_FIELDS 2"));
|
||||
DBUG_PRINT("info", ("PACK_TYPE_ZERO_FILL 4"));
|
||||
DBUG_PRINT("info", (""));
|
||||
DBUG_PRINT("info", (" "));
|
||||
if (verbose >= 2)
|
||||
{
|
||||
VOID(printf("\n"));
|
||||
@@ -2126,7 +2126,7 @@ static my_off_t write_huff_tree(HUFF_TREE *huff_tree, uint trees)
|
||||
return 0;
|
||||
}
|
||||
|
||||
DBUG_PRINT("info", (""));
|
||||
DBUG_PRINT("info", (" "));
|
||||
if (verbose >= 2)
|
||||
VOID(printf("\n"));
|
||||
tree_no= 0;
|
||||
@@ -2137,7 +2137,7 @@ static my_off_t write_huff_tree(HUFF_TREE *huff_tree, uint trees)
|
||||
if (huff_tree->tree_number == 0)
|
||||
continue; /* Deleted tree */
|
||||
tree_no++;
|
||||
DBUG_PRINT("info", (""));
|
||||
DBUG_PRINT("info", (" "));
|
||||
if (verbose >= 3)
|
||||
VOID(printf("\n"));
|
||||
/* Count the total number of elements (byte codes or column values). */
|
||||
@@ -2329,7 +2329,7 @@ static my_off_t write_huff_tree(HUFF_TREE *huff_tree, uint trees)
|
||||
}
|
||||
flush_bits();
|
||||
}
|
||||
DBUG_PRINT("info", (""));
|
||||
DBUG_PRINT("info", (" "));
|
||||
if (verbose >= 2)
|
||||
VOID(printf("\n"));
|
||||
my_afree((gptr) packed_tree);
|
||||
@@ -2507,7 +2507,7 @@ static int compress_isam_file(PACK_MRG_INFO *mrg, HUFF_COUNTS *huff_counts)
|
||||
end_pos-=count->max_zero_fill;
|
||||
field_length-=count->max_zero_fill;
|
||||
|
||||
switch(count->field_type) {
|
||||
switch (count->field_type) {
|
||||
case FIELD_SKIP_ZERO:
|
||||
if (!memcmp((byte*) start_pos,zero_string,field_length))
|
||||
{
|
||||
@@ -2726,6 +2726,7 @@ static int compress_isam_file(PACK_MRG_INFO *mrg, HUFF_COUNTS *huff_counts)
|
||||
break;
|
||||
}
|
||||
case FIELD_LAST:
|
||||
case FIELD_enum_val_count:
|
||||
abort(); /* Impossible */
|
||||
}
|
||||
start_pos+=count->max_zero_fill;
|
||||
|
@@ -28,7 +28,7 @@ int myrg_extra(MYRG_INFO *info,enum ha_extra_function function,
|
||||
int error,save_error=0;
|
||||
MYRG_TABLE *file;
|
||||
DBUG_ENTER("myrg_extra");
|
||||
DBUG_PRINT("info",("function: %d",(ulong) function));
|
||||
DBUG_PRINT("info",("function: %lu", (ulong) function));
|
||||
|
||||
if (function == HA_EXTRA_CACHE)
|
||||
{
|
||||
|
@@ -5,7 +5,7 @@ source ./include/master-slave.inc;
|
||||
# remote table creation
|
||||
|
||||
connection slave;
|
||||
--replicate-ignore-db=federated
|
||||
#--replicate-ignore-db=federated
|
||||
stop slave;
|
||||
|
||||
--disable_warnings
|
||||
|
@@ -1,6 +1,6 @@
|
||||
delimiter |;
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
CREATE PROCEDURE sp_vars_check_dflt()
|
||||
BEGIN
|
||||
@@ -40,7 +40,7 @@ BEGIN
|
||||
SELECT v17, v18, v19, v20;
|
||||
END|
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
CREATE PROCEDURE sp_vars_check_assignment()
|
||||
BEGIN
|
||||
@@ -89,35 +89,35 @@ BEGIN
|
||||
SELECT d1, d2, d3;
|
||||
END|
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
CREATE FUNCTION sp_vars_check_ret1() RETURNS TINYINT
|
||||
BEGIN
|
||||
RETURN 1e200;
|
||||
END|
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
CREATE FUNCTION sp_vars_check_ret2() RETURNS TINYINT
|
||||
BEGIN
|
||||
RETURN 10 * 10 * 10;
|
||||
END|
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
CREATE FUNCTION sp_vars_check_ret3() RETURNS TINYINT
|
||||
BEGIN
|
||||
RETURN 'Hello, world';
|
||||
END|
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
CREATE FUNCTION sp_vars_check_ret4() RETURNS DECIMAL(64, 2)
|
||||
BEGIN
|
||||
RETURN 12 * 10 + 34 + 0.1234;
|
||||
END|
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
CREATE FUNCTION sp_vars_div_zero() RETURNS INTEGER
|
||||
BEGIN
|
||||
@@ -126,6 +126,6 @@ BEGIN
|
||||
RETURN div_zero;
|
||||
END|
|
||||
|
||||
---------------------------------------------------------------------------
|
||||
# --------------------------------------------------------------------------
|
||||
|
||||
delimiter ;|
|
||||
|
@@ -89,10 +89,14 @@ sub mtr_report_test_skipped ($) {
|
||||
{
|
||||
print "[ disabled ] $tinfo->{'comment'}\n";
|
||||
}
|
||||
else
|
||||
elsif ( $tinfo->{'comment'} )
|
||||
{
|
||||
print "[ skipped ] $tinfo->{'comment'}\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
print "[ skipped ]\n";
|
||||
}
|
||||
}
|
||||
|
||||
sub mtr_report_tests_not_skipped_though_disabled ($) {
|
||||
|
156
mysql-test/lib/mtr_unique.pl
Normal file
156
mysql-test/lib/mtr_unique.pl
Normal file
@@ -0,0 +1,156 @@
|
||||
#
|
||||
# This file is used from mysql-test-run.pl when choosing
|
||||
# port numbers and directories to use for running mysqld.
|
||||
#
|
||||
|
||||
use strict;
|
||||
use Fcntl ':flock';
|
||||
|
||||
#
|
||||
# Requested IDs are stored in a hash and released upon END.
|
||||
#
|
||||
my %mtr_unique_assigned_ids = ();
|
||||
END {
|
||||
while(my ($id,$file) = each(%mtr_unique_assigned_ids)) {
|
||||
print "Autoreleasing $file:$id\n";
|
||||
mtr_release_unique_id($file, $id);
|
||||
}
|
||||
}
|
||||
|
||||
#
|
||||
# Require a unique, numerical ID, given a file name (where all
|
||||
# requested IDs are stored), a minimum and a maximum value.
|
||||
#
|
||||
# We use flock to implement locking for the ID file and ignore
|
||||
# possible problems arising from lack of support for it on
|
||||
# some platforms (it should work on most, and the possible
|
||||
# race condition would occur rarely). The proper solution for
|
||||
# this is a daemon that manages IDs, of course.
|
||||
#
|
||||
# If no unique ID within the specified parameters can be
|
||||
# obtained, return undef.
|
||||
#
|
||||
sub mtr_require_unique_id($$$) {
|
||||
my $file = shift;
|
||||
my $min = shift;
|
||||
my $max = shift;
|
||||
my $ret = undef;
|
||||
my $changed = 0;
|
||||
|
||||
my $can_use_ps = `ps -e | grep '^[ ]*$$ '`;
|
||||
|
||||
if(eval("readlink '$file'") || eval("readlink '$file.sem'")) {
|
||||
die 'lock file is a symbolic link';
|
||||
}
|
||||
|
||||
chmod 0777, "$file.sem";
|
||||
open SEM, ">", "$file.sem" or die "can't write to $file.sem";
|
||||
flock SEM, LOCK_EX or die "can't lock $file.sem";
|
||||
if(! -e $file) {
|
||||
open FILE, ">", $file or die "can't create $file";
|
||||
close FILE;
|
||||
}
|
||||
|
||||
if(eval("readlink '$file'") || eval("readlink '$file.sem'")) {
|
||||
die 'lock file is a symbolic link';
|
||||
}
|
||||
|
||||
chmod 0777, $file;
|
||||
open FILE, "+<", $file or die "can't open $file";
|
||||
select undef,undef,undef,0.2;
|
||||
seek FILE, 0, 0;
|
||||
my %taken = ();
|
||||
while(<FILE>) {
|
||||
chomp;
|
||||
my ($id, $pid) = split / /;
|
||||
$taken{$id} = $pid;
|
||||
if($can_use_ps) {
|
||||
my $res = `ps -e | grep '^[ ]*$pid '`;
|
||||
if(!$res) {
|
||||
print "Ignoring slot $id used by missing process $pid.\n";
|
||||
delete $taken{$id};
|
||||
++$changed;
|
||||
}
|
||||
}
|
||||
}
|
||||
for(my $i=$min; $i<=$max; ++$i) {
|
||||
if(! exists $taken{$i}) {
|
||||
$ret = $i;
|
||||
$taken{$i} = $$;
|
||||
++$changed;
|
||||
last;
|
||||
}
|
||||
}
|
||||
if($changed) {
|
||||
seek FILE, 0, 0;
|
||||
truncate FILE, 0 or die "can't truncate $file";
|
||||
for my $k (keys %taken) {
|
||||
print FILE $k . ' ' . $taken{$k} . "\n";
|
||||
}
|
||||
}
|
||||
close FILE;
|
||||
flock SEM, LOCK_UN or warn "can't unlock $file.sem";
|
||||
close SEM;
|
||||
$mtr_unique_assigned_ids{$ret} = $file if defined $ret;
|
||||
return $ret;
|
||||
}
|
||||
|
||||
#
|
||||
# Require a unique ID like above, but sleep if no ID can be
|
||||
# obtained immediately.
|
||||
#
|
||||
sub mtr_require_unique_id_and_wait($$$) {
|
||||
my $ret = mtr_require_unique_id($_[0],$_[1],$_[2]);
|
||||
while(! defined $ret) {
|
||||
sleep 30;
|
||||
$ret = mtr_require_unique_id($_[0],$_[1],$_[2]);
|
||||
print "Waiting for unique id to become available...\n" unless $ret;
|
||||
}
|
||||
return $ret;
|
||||
}
|
||||
|
||||
#
|
||||
# Release a unique ID.
|
||||
#
|
||||
sub mtr_release_unique_id($$) {
|
||||
my $file = shift;
|
||||
my $myid = shift;
|
||||
|
||||
if(eval("readlink '$file'") || eval("readlink '$file.sem'")) {
|
||||
die 'lock file is a symbolic link';
|
||||
}
|
||||
|
||||
open SEM, ">", "$file.sem" or die "can't write to $file.sem";
|
||||
flock SEM, LOCK_EX or die "can't lock $file.sem";
|
||||
|
||||
if(eval("readlink '$file'") || eval("readlink '$file.sem'")) {
|
||||
die 'lock file is a symbolic link';
|
||||
}
|
||||
|
||||
if(! -e $file) {
|
||||
open FILE, ">", $file or die "can't create $file";
|
||||
close FILE;
|
||||
}
|
||||
open FILE, "+<", $file or die "can't open $file";
|
||||
select undef,undef,undef,0.2;
|
||||
seek FILE, 0, 0;
|
||||
my %taken = ();
|
||||
while(<FILE>) {
|
||||
chomp;
|
||||
my ($id, $pid) = split / /;
|
||||
$taken{$id} = $pid;
|
||||
}
|
||||
delete $taken{$myid};
|
||||
seek FILE, 0, 0;
|
||||
truncate FILE, 0 or die "can't truncate $file";
|
||||
for my $k (keys %taken) {
|
||||
print FILE $k . ' ' . $taken{$k} . "\n";
|
||||
}
|
||||
close FILE;
|
||||
flock SEM, LOCK_UN or warn "can't unlock $file.sem";
|
||||
close SEM;
|
||||
delete $mtr_unique_assigned_ids{$myid};
|
||||
}
|
||||
|
||||
1;
|
||||
|
@@ -63,10 +63,8 @@ use Getopt::Long;
|
||||
use Sys::Hostname;
|
||||
use IO::Socket;
|
||||
use IO::Socket::INET;
|
||||
use Data::Dumper;
|
||||
use strict;
|
||||
use warnings;
|
||||
use diagnostics;
|
||||
|
||||
select(STDOUT);
|
||||
$| = 1; # Automatically flush STDOUT
|
||||
@@ -88,6 +86,7 @@ require "lib/mtr_diff.pl";
|
||||
require "lib/mtr_match.pl";
|
||||
require "lib/mtr_misc.pl";
|
||||
require "lib/mtr_stress.pl";
|
||||
require "lib/mtr_unique.pl";
|
||||
|
||||
$Devel::Trace::TRACE= 1;
|
||||
|
||||
@@ -199,6 +198,7 @@ our $opt_client_ddd;
|
||||
our $opt_manual_gdb;
|
||||
our $opt_manual_ddd;
|
||||
our $opt_manual_debug;
|
||||
our $opt_mtr_build_thread=0;
|
||||
our $opt_debugger;
|
||||
our $opt_client_debugger;
|
||||
|
||||
@@ -213,6 +213,11 @@ our $clusters;
|
||||
|
||||
our $instance_manager;
|
||||
|
||||
our $opt_master_myport;
|
||||
our $opt_slave_myport;
|
||||
our $im_port;
|
||||
our $im_mysqld1_port;
|
||||
our $im_mysqld2_port;
|
||||
our $opt_ndbcluster_port;
|
||||
our $opt_ndbconnectstring;
|
||||
our $opt_ndbcluster_port_slave;
|
||||
@@ -313,6 +318,7 @@ our %mysqld_variables;
|
||||
sub main ();
|
||||
sub initial_setup ();
|
||||
sub command_line_setup ();
|
||||
sub set_mtr_build_thread_ports($);
|
||||
sub datadir_setup ();
|
||||
sub executable_setup ();
|
||||
sub environment_setup ();
|
||||
@@ -441,7 +447,6 @@ sub main () {
|
||||
mtr_exit(0);
|
||||
}
|
||||
|
||||
|
||||
##############################################################################
|
||||
#
|
||||
# Default settings
|
||||
@@ -455,45 +460,17 @@ sub command_line_setup () {
|
||||
$opt_suite= "main"; # Special default suite
|
||||
my $opt_comment;
|
||||
|
||||
my $opt_master_myport= 9306;
|
||||
my $opt_slave_myport= 9308;
|
||||
$opt_master_myport= 9306;
|
||||
$opt_slave_myport= 9308;
|
||||
$opt_ndbcluster_port= 9310;
|
||||
$opt_ndbcluster_port_slave= 9311;
|
||||
my $im_port= 9312;
|
||||
my $im_mysqld1_port= 9313;
|
||||
my $im_mysqld2_port= 9314;
|
||||
$im_port= 9312;
|
||||
$im_mysqld1_port= 9313;
|
||||
$im_mysqld2_port= 9314;
|
||||
|
||||
#
|
||||
# To make it easier for different devs to work on the same host,
|
||||
# an environment variable can be used to control all ports. A small
|
||||
# number is to be used, 0 - 16 or similar.
|
||||
#
|
||||
# Note the MASTER_MYPORT has to be set the same in all 4.x and 5.x
|
||||
# versions of this script, else a 4.0 test run might conflict with a
|
||||
# 5.1 test run, even if different MTR_BUILD_THREAD is used. This means
|
||||
# all port numbers might not be used in this version of the script.
|
||||
#
|
||||
# Also note the limiteation of ports we are allowed to hand out. This
|
||||
# differs between operating systems and configuration, see
|
||||
# http://www.ncftp.com/ncftpd/doc/misc/ephemeral_ports.html
|
||||
# But a fairly safe range seems to be 5001 - 32767
|
||||
if ( $ENV{'MTR_BUILD_THREAD'} )
|
||||
{
|
||||
# Up to two masters, up to three slaves
|
||||
$opt_master_myport= $ENV{'MTR_BUILD_THREAD'} * 10 + 10000; # and 1
|
||||
$opt_slave_myport= $opt_master_myport + 2; # and 3 4
|
||||
$opt_ndbcluster_port= $opt_master_myport + 5;
|
||||
$opt_ndbcluster_port_slave= $opt_master_myport + 6;
|
||||
$im_port= $opt_master_myport + 7;
|
||||
$im_mysqld1_port= $opt_master_myport + 8;
|
||||
$im_mysqld2_port= $opt_master_myport + 9;
|
||||
}
|
||||
|
||||
if ( $opt_master_myport < 5001 or $opt_master_myport + 10 >= 32767 )
|
||||
{
|
||||
mtr_error("MTR_BUILD_THREAD number results in a port",
|
||||
"outside 5001 - 32767",
|
||||
"($opt_master_myport - $opt_master_myport + 10)");
|
||||
set_mtr_build_thread_ports($ENV{'MTR_BUILD_THREAD'});
|
||||
}
|
||||
|
||||
# This is needed for test log evaluation in "gen-build-status-page"
|
||||
@@ -545,6 +522,7 @@ sub command_line_setup () {
|
||||
'im-port=i' => \$im_port, # Instance Manager port.
|
||||
'im-mysqld1-port=i' => \$im_mysqld1_port, # Port of mysqld, controlled by IM
|
||||
'im-mysqld2-port=i' => \$im_mysqld2_port, # Port of mysqld, controlled by IM
|
||||
'mtr-build-thread=i' => \$opt_mtr_build_thread,
|
||||
|
||||
# Test case authoring
|
||||
'record' => \$opt_record,
|
||||
@@ -627,6 +605,15 @@ sub command_line_setup () {
|
||||
|
||||
$glob_scriptname= basename($0);
|
||||
|
||||
if ($opt_mtr_build_thread != 0)
|
||||
{
|
||||
set_mtr_build_thread_ports($opt_mtr_build_thread)
|
||||
}
|
||||
elsif ($ENV{'MTR_BUILD_THREAD'})
|
||||
{
|
||||
$opt_mtr_build_thread= $ENV{'MTR_BUILD_THREAD'};
|
||||
}
|
||||
|
||||
# We require that we are in the "mysql-test" directory
|
||||
# to run mysql-test-run
|
||||
if (! -f $glob_scriptname)
|
||||
@@ -775,7 +762,7 @@ sub command_line_setup () {
|
||||
{
|
||||
mtr_report("Using tmpfs in $fs");
|
||||
$opt_mem= "$fs/var";
|
||||
$opt_mem .= $ENV{'MTR_BUILD_THREAD'} if $ENV{'MTR_BUILD_THREAD'};
|
||||
$opt_mem .= $opt_mtr_build_thread if $opt_mtr_build_thread;
|
||||
last;
|
||||
}
|
||||
}
|
||||
@@ -1230,6 +1217,43 @@ sub command_line_setup () {
|
||||
$path_snapshot= "$opt_tmpdir/snapshot_$opt_master_myport/";
|
||||
}
|
||||
|
||||
#
|
||||
# To make it easier for different devs to work on the same host,
|
||||
# an environment variable can be used to control all ports. A small
|
||||
# number is to be used, 0 - 16 or similar.
|
||||
#
|
||||
# Note the MASTER_MYPORT has to be set the same in all 4.x and 5.x
|
||||
# versions of this script, else a 4.0 test run might conflict with a
|
||||
# 5.1 test run, even if different MTR_BUILD_THREAD is used. This means
|
||||
# all port numbers might not be used in this version of the script.
|
||||
#
|
||||
# Also note the limitation of ports we are allowed to hand out. This
|
||||
# differs between operating systems and configuration, see
|
||||
# http://www.ncftp.com/ncftpd/doc/misc/ephemeral_ports.html
|
||||
# But a fairly safe range seems to be 5001 - 32767
|
||||
#
|
||||
|
||||
sub set_mtr_build_thread_ports() {
|
||||
my $mtr_build_thread= shift;
|
||||
|
||||
# Up to two masters, up to three slaves
|
||||
$opt_master_myport= $mtr_build_thread * 10 + 10000; # and 1
|
||||
$opt_slave_myport= $opt_master_myport + 2; # and 3 4
|
||||
$opt_ndbcluster_port= $opt_master_myport + 5;
|
||||
$opt_ndbcluster_port_slave= $opt_master_myport + 6;
|
||||
$im_port= $opt_master_myport + 7;
|
||||
$im_mysqld1_port= $opt_master_myport + 8;
|
||||
$im_mysqld2_port= $opt_master_myport + 9;
|
||||
|
||||
if ( $opt_master_myport < 5001 or $opt_master_myport + 10 >= 32767 )
|
||||
{
|
||||
mtr_error("MTR_BUILD_THREAD number results in a port",
|
||||
"outside 5001 - 32767",
|
||||
"($opt_master_myport - $opt_master_myport + 10)");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
sub datadir_setup () {
|
||||
|
||||
# Make a list of all data_dirs
|
||||
@@ -1499,7 +1523,7 @@ sub executable_setup () {
|
||||
$exe_mysql_client_test=
|
||||
mtr_exe_maybe_exists(vs_config_dirs('tests', 'mysql_client_test'),
|
||||
"$glob_basedir/tests/mysql_client_test",
|
||||
"$glob_basedir/bin");
|
||||
"$glob_basedir/bin/mysql_client_test");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1576,7 +1600,8 @@ sub environment_setup () {
|
||||
if ( $opt_source_dist )
|
||||
{
|
||||
push(@ld_library_paths, "$glob_basedir/libmysql/.libs/",
|
||||
"$glob_basedir/libmysql_r/.libs/");
|
||||
"$glob_basedir/libmysql_r/.libs/",
|
||||
"$glob_basedir/zlib.libs/");
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1647,7 +1672,7 @@ sub environment_setup () {
|
||||
$ENV{'IM_PATH_SOCK'}= $instance_manager->{path_sock};
|
||||
$ENV{'IM_USERNAME'}= $instance_manager->{admin_login};
|
||||
$ENV{'IM_PASSWORD'}= $instance_manager->{admin_password};
|
||||
$ENV{MTR_BUILD_THREAD}= 0 unless $ENV{MTR_BUILD_THREAD}; # Set if not set
|
||||
$ENV{MTR_BUILD_THREAD}= $opt_mtr_build_thread;
|
||||
|
||||
$ENV{'EXE_MYSQL'}= $exe_mysql;
|
||||
|
||||
@@ -2045,6 +2070,12 @@ sub cleanup_stale_files () {
|
||||
}
|
||||
closedir(DIR);
|
||||
}
|
||||
|
||||
# Remove old log files
|
||||
foreach my $name (glob("r/*.progress r/*.log r/*.warnings"))
|
||||
{
|
||||
unlink($name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2425,8 +2456,8 @@ sub ndbcluster_start ($$) {
|
||||
|
||||
sub rm_ndbcluster_tables ($) {
|
||||
my $dir= shift;
|
||||
foreach my $bin ( glob("$dir/cluster/apply_status*"),
|
||||
glob("$dir/cluster/schema*") )
|
||||
foreach my $bin ( glob("$dir/mysql/apply_status*"),
|
||||
glob("$dir/mysql/schema*"))
|
||||
{
|
||||
unlink($bin);
|
||||
}
|
||||
@@ -2989,14 +3020,14 @@ sub find_testcase_skipped_reason($)
|
||||
{
|
||||
my ($tinfo)= @_;
|
||||
|
||||
# Open mysqltest.log
|
||||
# Open mysqltest-time
|
||||
my $F= IO::File->new($path_timefile) or
|
||||
mtr_error("can't open file \"$path_timefile\": $!");
|
||||
my $reason;
|
||||
|
||||
while ( my $line= <$F> )
|
||||
{
|
||||
# Look for "reason: <reason fo skiping test>"
|
||||
# Look for "reason: <reason for skipping test>"
|
||||
if ( $line =~ /reason: (.*)/ )
|
||||
{
|
||||
$reason= $1;
|
||||
@@ -4089,12 +4120,12 @@ sub run_testcase_start_servers($) {
|
||||
# tables ok FIXME This is a workaround so that only one mysqld
|
||||
# create the tables
|
||||
if ( ! sleep_until_file_created(
|
||||
"$master->[0]->{'path_myddir'}/cluster/apply_status.ndb",
|
||||
"$master->[0]->{'path_myddir'}/mysql/apply_status.ndb",
|
||||
$master->[0]->{'start_timeout'},
|
||||
$master->[0]->{'pid'}))
|
||||
{
|
||||
|
||||
$tinfo->{'comment'}= "Failed to create 'cluster/apply_status' table";
|
||||
$tinfo->{'comment'}= "Failed to create 'mysql/apply_status' table";
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -4748,6 +4779,8 @@ Options that specify ports
|
||||
slave_port=PORT Specify the port number used by the first slave
|
||||
ndbcluster-port=PORT Specify the port number used by cluster
|
||||
ndbcluster-port-slave=PORT Specify the port number used by slave cluster
|
||||
mtr-build-thread=# Specify unique collection of ports. Can also be set by
|
||||
setting the environment variable MTR_BUILD_THREAD.
|
||||
|
||||
Options for test case authoring
|
||||
|
||||
|
@@ -123,7 +123,7 @@ find_valgrind()
|
||||
fi
|
||||
# >=2.1.2 requires the --tool option, some versions write to stdout, some to stderr
|
||||
valgrind --help 2>&1 | grep "\-\-tool" > /dev/null && FIND_VALGRIND="$FIND_VALGRIND --tool=memcheck"
|
||||
FIND_VALGRIND="$FIND_VALGRIND --alignment=8 --leak-check=yes --num-callers=16 --suppressions=$CWD/valgrind.supp"
|
||||
FIND_VALGRIND="$FIND_VALGRIND --alignment=8 --leak-check=yes --num-callers=16 --suppressions=$MYSQL_TEST_DIR/valgrind.supp"
|
||||
}
|
||||
|
||||
# No paths below as we can't be sure where the program is!
|
||||
@@ -182,19 +182,14 @@ if [ -d ./sql ] ; then
|
||||
SOURCE_DIST=1
|
||||
else
|
||||
BINARY_DIST=1
|
||||
fi
|
||||
|
||||
# ... one level for tar.gz, two levels for a RPM installation
|
||||
if [ -d ./bin ] ; then
|
||||
# this is not perfect: we have
|
||||
# /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 ..
|
||||
BASEDIR=`pwd`
|
||||
# ... one level for tar.gz, two levels for a RPM installation
|
||||
if [ ! -f ./bin/mysql_upgrade ] ; then
|
||||
# Has to be RPM installation
|
||||
cd ..
|
||||
fi
|
||||
fi
|
||||
BASEDIR=`pwd`
|
||||
|
||||
cd $MYSQL_TEST_DIR
|
||||
MYSQL_TEST_WINDIR=$MYSQL_TEST_DIR
|
||||
@@ -2092,12 +2087,15 @@ then
|
||||
|
||||
# Remove files that can cause problems
|
||||
$RM -rf $MYSQL_TEST_DIR/var/ndbcluster
|
||||
$RM -f $MYSQL_TEST_DIR/var/run/* $MYSQL_TEST_DIR/var/tmp/*
|
||||
$RM -rf $MYSQL_TEST_DIR/var/run/* $MYSQL_TEST_DIR/var/tmp/*
|
||||
|
||||
# Remove old berkeley db log files that can confuse the server
|
||||
$RM -f $MASTER_MYDDIR/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_slave=$SLEEP_TIME_FOR_FIRST_SLAVE
|
||||
$ECHO "Installing Test Databases"
|
||||
|
@@ -1,3 +1,4 @@
|
||||
DROP TABLE IF EXISTS t1;
|
||||
SHOW COLLATION LIKE 'cp1250_czech_cs';
|
||||
Collation Charset Id Default Compiled Sortlen
|
||||
cp1250_czech_cs cp1250 34 Yes 2
|
||||
|
@@ -550,7 +550,7 @@ create table t1 (
|
||||
a varchar(112) charset utf8 collate utf8_bin not null,
|
||||
primary key (a)
|
||||
) select 'test' as a ;
|
||||
--warning 1364
|
||||
#--warning 1364
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
||||
@@ -563,7 +563,7 @@ CREATE TABLE t2 (
|
||||
);
|
||||
insert into t2 values(111);
|
||||
|
||||
--warning 1364
|
||||
#--warning 1364
|
||||
create table t1 (
|
||||
a varchar(12) charset utf8 collate utf8_bin not null,
|
||||
b int not null, primary key (a)
|
||||
@@ -571,7 +571,7 @@ create table t1 (
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
||||
--warning 1364
|
||||
#--warning 1364
|
||||
create table t1 (
|
||||
a varchar(12) charset utf8 collate utf8_bin not null,
|
||||
b int not null, primary key (a)
|
||||
@@ -579,7 +579,7 @@ create table t1 (
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
||||
--warning 1364
|
||||
#--warning 1364
|
||||
create table t1 (
|
||||
a varchar(12) charset utf8 collate utf8_bin not null,
|
||||
b int null, primary key (a)
|
||||
@@ -587,7 +587,7 @@ create table t1 (
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
||||
--warning 1364
|
||||
#--warning 1364
|
||||
create table t1 (
|
||||
a varchar(12) charset utf8 collate utf8_bin not null,
|
||||
b int not null, primary key (a)
|
||||
@@ -595,7 +595,7 @@ create table t1 (
|
||||
show create table t1;
|
||||
drop table t1;
|
||||
|
||||
--warning 1364
|
||||
#--warning 1364
|
||||
create table t1 (
|
||||
a varchar(12) charset utf8 collate utf8_bin,
|
||||
b int not null, primary key (a)
|
||||
@@ -609,7 +609,7 @@ create table t1 (
|
||||
);
|
||||
insert into t1 values (1,1,1, 1,1,1, 1,1,1);
|
||||
|
||||
--warning 1364
|
||||
#--warning 1364
|
||||
create table t2 (
|
||||
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,
|
||||
@@ -617,20 +617,20 @@ create table t2 (
|
||||
) select a1,a2,a3,a4,a5,a6,a7,a8,a9 from t1 ;
|
||||
drop table t2;
|
||||
|
||||
--warning 1364
|
||||
#--warning 1364
|
||||
create table t2 (
|
||||
a1 varchar(12) charset utf8 collate utf8_bin,
|
||||
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;
|
||||
|
||||
drop table t1, t2;
|
||||
--warning 1364
|
||||
#--warning 1364
|
||||
create table t1 (
|
||||
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);
|
||||
|
||||
--warning 1364
|
||||
#--warning 1364
|
||||
create table t2 (
|
||||
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,
|
||||
|
@@ -1360,27 +1360,27 @@ DROP TABLE bug14672;
|
||||
create table t1 (a int) engine=csv;
|
||||
insert t1 values (1);
|
||||
--enable_info
|
||||
delete from t1; -- delete_row
|
||||
delete from t1; -- delete_all_rows
|
||||
delete from t1; # delete_row
|
||||
delete from t1; # delete_all_rows
|
||||
--disable_info
|
||||
insert t1 values (1),(2);
|
||||
--enable_info
|
||||
delete from t1; -- delete_all_rows
|
||||
delete from t1; # delete_all_rows
|
||||
--disable_info
|
||||
insert t1 values (1),(2),(3);
|
||||
flush tables;
|
||||
--enable_info
|
||||
delete from t1; -- delete_row
|
||||
delete from t1; # delete_row
|
||||
--disable_info
|
||||
insert t1 values (1),(2),(3),(4);
|
||||
flush tables;
|
||||
select count(*) from t1;
|
||||
--enable_info
|
||||
delete from t1; -- delete_all_rows
|
||||
delete from t1; # delete_all_rows
|
||||
--disable_info
|
||||
insert t1 values (1),(2),(3),(4),(5);
|
||||
--enable_info
|
||||
truncate table t1; -- truncate
|
||||
truncate table t1; # truncate
|
||||
--disable_info
|
||||
drop table t1;
|
||||
|
||||
|
@@ -59,7 +59,7 @@ 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 COLLATE latin1_swedish_ci;
|
||||
@@ -69,9 +69,9 @@ SELECT latin1_f FROM t1 ORDER BY latin1_f COLLATE latin1_bin;
|
||||
--error 1253
|
||||
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_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;
|
||||
@@ -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;
|
||||
|
||||
|
||||
-- GROUP BY
|
||||
# GROUP BY
|
||||
|
||||
SELECT latin1_f,count(*) FROM t1 GROUP BY latin1_f;
|
||||
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;
|
||||
|
||||
|
||||
-- DISTINCT
|
||||
# DISTINCT
|
||||
|
||||
SELECT DISTINCT latin1_f 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;
|
||||
|
||||
|
||||
-- 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
|
||||
# Aggregates
|
||||
|
||||
--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
|
||||
|
@@ -1,5 +1,9 @@
|
||||
-- source include/have_cp1250_ch.inc
|
||||
|
||||
--disable_warnings
|
||||
DROP TABLE IF EXISTS t1;
|
||||
--enable_warnings
|
||||
|
||||
SHOW COLLATION LIKE 'cp1250_czech_cs';
|
||||
|
||||
#
|
||||
|
@@ -298,7 +298,7 @@ INSERT INTO t1 VALUES (0xA),(0xAA),(0xAAA),(0xAAAA),(0xAAAAA);
|
||||
SELECT HEX(a) FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
-- the same should be also done with enum and set
|
||||
# the same should be also done with enum and set
|
||||
|
||||
|
||||
#
|
||||
|
@@ -35,7 +35,7 @@ SET @@SQL_MODE="ALLOW_INVALID_DATES";
|
||||
select datediff("1997-11-31 23:59:59.000001","1997-12-31");
|
||||
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-30 23:59:59.000001",null);
|
||||
|
||||
|
@@ -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 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);
|
||||
--select FIND_IN_SET(_latin1'B' COLLATE latin1_bin,_latin1'a,b,c,d');
|
||||
|
||||
# fix this:
|
||||
--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
|
||||
select FIND_IN_SET(_latin1'B' COLLATE latin1_general_ci,_latin1'a,b,c,d' COLLATE latin1_bin);
|
||||
--error 1267
|
||||
select FIND_IN_SET(_latin1'B',_latin2'a,b,c,d');
|
||||
|
||||
select SUBSTRING_INDEX(_latin1'abcdabcdabcd',_latin1'd',2);
|
||||
--fix this:
|
||||
--select SUBSTRING_INDEX(_latin1'abcdabcdabcd' COLLATE latin1_bin,_latin1'd',2);
|
||||
--select SUBSTRING_INDEX(_latin1'abcdabcdabcd',_latin1'd' COLLATE latin1_bin,2);
|
||||
|
||||
# fix this:
|
||||
--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
|
||||
select SUBSTRING_INDEX(_latin1'abcdabcdabcd',_latin2'd',2);
|
||||
--error 1267
|
||||
|
@@ -118,7 +118,7 @@ drop table t1;
|
||||
#
|
||||
--error 1221
|
||||
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
|
||||
|
@@ -140,18 +140,18 @@ insert into t7 values (21,2,3,4,5,6);
|
||||
select @@optimizer_search_depth;
|
||||
select @@optimizer_prune_level;
|
||||
|
||||
-- This value swithes back to the old implementation of 'find_best()'
|
||||
-- set optimizer_search_depth=63; - old (independent of the optimizer_prune_level)
|
||||
# This value swithes back to the old implementation of 'find_best()'
|
||||
# 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
|
||||
-- (total 6 combinations - 3 for optimizer_search_depth, 2 for optimizer_prune_level):
|
||||
# set optimizer_search_depth=0; - automatic
|
||||
# set optimizer_search_depth=1; - min
|
||||
# set optimizer_search_depth=62; - max (default)
|
||||
--
|
||||
-- set optimizer_search_depth=0; - automatic
|
||||
-- set optimizer_search_depth=1; - min
|
||||
-- set optimizer_search_depth=62; - max (default)
|
||||
--
|
||||
-- set optimizer_prune_level=0 - exhaustive;
|
||||
-- set optimizer_prune_level=1 - heuristic; -- 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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
@@ -195,17 +195,17 @@ select @@optimizer_prune_level;
|
||||
set optimizer_search_depth=0;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
@@ -214,17 +214,17 @@ show status like 'Last_query_cost';
|
||||
set optimizer_search_depth=1;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
@@ -233,17 +233,17 @@ show status like 'Last_query_cost';
|
||||
set optimizer_search_depth=62;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
@@ -256,17 +256,17 @@ select @@optimizer_prune_level;
|
||||
set optimizer_search_depth=0;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
@@ -275,17 +275,17 @@ show status like 'Last_query_cost';
|
||||
set optimizer_search_depth=1;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
@@ -294,17 +294,17 @@ show status like 'Last_query_cost';
|
||||
set optimizer_search_depth=62;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
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;
|
||||
|
@@ -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);
|
||||
analyze table t1;
|
||||
|
||||
-- t2 is the same as t1, but with some NULLs in the MIN/MAX column, and one more
|
||||
-- nullable attribute
|
||||
# t2 is the same as t1, but with some NULLs in the MIN/MAX column, and
|
||||
# one more nullable attribute
|
||||
|
||||
--disable_warnings
|
||||
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 ' '
|
||||
);
|
||||
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
|
||||
('a','a',NULL,'a777','xyz'),('a','a',NULL,'a888','xyz'),('a','a',NULL,'a999','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);
|
||||
analyze table t2;
|
||||
|
||||
-- Table t3 is the same as t1, but with smaller column lenghts.
|
||||
-- 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
|
||||
-- sub-groups formed by predicates over non-group attributes.
|
||||
# Table t3 is the same as t1, but with smaller column lenghts.
|
||||
# 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
|
||||
# sub-groups formed by predicates over non-group attributes.
|
||||
|
||||
--disable_warnings
|
||||
drop table if exists t3;
|
||||
@@ -164,11 +164,11 @@ create index idx_t3_2 on t3 (a1,a2,b);
|
||||
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, 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;
|
||||
--replace_column 7 # 9 #
|
||||
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 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 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, 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,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 fields in different order
|
||||
# Select fields in different order
|
||||
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 min(a2) from t1 group by a1;
|
||||
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
|
||||
-- plans
|
||||
# A) Preds only over the group 'A' attributes
|
||||
# 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 >= '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 #
|
||||
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 >= '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, max(c) from t2 where a1 in ('a','b','d') group by a1,a2,b;
|
||||
|
||||
-- B) Equalities only over the non-group 'B' attributes
|
||||
-- plans
|
||||
# B) Equalities only over the non-group 'B' attributes
|
||||
# plans
|
||||
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,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, 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,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,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;
|
||||
@@ -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, 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,max(c),min(c) from t3 where (a2 = 'a') and (b = 'b') group by a1;
|
||||
|
||||
|
||||
-- IS NULL (makes sense for t2 only)
|
||||
-- plans
|
||||
# IS NULL (makes sense for t2 only)
|
||||
# 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,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,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,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;
|
||||
@@ -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;
|
||||
|
||||
-- C) Range predicates for the MIN/MAX attribute
|
||||
-- plans
|
||||
# C) Range predicates for the MIN/MAX attribute
|
||||
# plans
|
||||
--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,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 #
|
||||
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,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;
|
||||
@@ -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 > '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
|
||||
where exists ( select * from t2 where t2.c = t1.c )
|
||||
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
|
||||
where exists ( select * from t2 where t2.c > 'b1' )
|
||||
group by a1,a2,b;
|
||||
|
||||
|
||||
-- A,B,C) Predicates referencing mixed classes of attributes
|
||||
-- plans
|
||||
# A,B,C) Predicates referencing mixed classes of attributes
|
||||
# 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 (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 #
|
||||
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 (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;
|
||||
|
||||
|
||||
--
|
||||
-- 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 (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;
|
||||
@@ -471,7 +471,7 @@ explain select a1,a2,b,c from t2 where (a2 >= 'b') and (b = 'a') and (c = 'i121'
|
||||
--replace_column 9 #
|
||||
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 (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;
|
||||
@@ -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 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 where (a2 >= 'b') and (b = 'a');
|
||||
explain select distinct a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121');
|
||||
@@ -502,7 +502,7 @@ explain select distinct a1,a2,b,c from t2 where (a2 >= 'b') and (b = 'a') and (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');
|
||||
|
||||
-- queries
|
||||
# queries
|
||||
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,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 b from t2 where (a2 >= 'b') and (b = 'a');
|
||||
|
||||
-- BUG #6303
|
||||
# BUG #6303
|
||||
select distinct t_00.a1
|
||||
from t1 t_00
|
||||
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 a2,a1,a2,a1 from t1;
|
||||
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 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;
|
||||
@@ -548,7 +548,7 @@ explain select distinct a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b =
|
||||
--replace_column 9 #
|
||||
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 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;
|
||||
@@ -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;
|
||||
|
||||
|
||||
--
|
||||
-- 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,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 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 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;
|
||||
|
||||
|
||||
--
|
||||
-- Negative examples: queries that should NOT be treated as optimizable by
|
||||
-- QUICK_GROUP_MIN_MAX_SELECT
|
||||
--
|
||||
#
|
||||
# Negative examples: queries that should NOT be treated as optimizable by
|
||||
# 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 from t1 group by a1,a2,b;
|
||||
|
||||
-- predicate that references an attribute that is after the MIN/MAX argument
|
||||
-- in the index
|
||||
# predicate that references an attribute that is after the MIN/MAX argument
|
||||
# in the index
|
||||
explain 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;
|
||||
|
||||
-- predicate that references a non-indexed attribute
|
||||
# predicate that references a non-indexed attribute
|
||||
explain 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;
|
||||
|
||||
explain 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;
|
||||
|
||||
-- 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 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
|
||||
-- MIN/MAX argument
|
||||
# non-group field with an equality predicate that references a keypart after the
|
||||
# MIN/MAX argument
|
||||
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;
|
||||
|
||||
-- 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;
|
||||
|
||||
-- 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
|
||||
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;
|
||||
|
||||
-- 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 where (a1 > 'a') group by a1,a2,b;
|
||||
explain select sum(ord(a1)) from t1 where (a1 > 'a') group by a1,a2,b;
|
||||
@@ -765,24 +765,24 @@ INSERT INTO t4 VALUES(1);
|
||||
INSERT INTO t5 VALUES(1,1);
|
||||
INSERT INTO t6 VALUES(1);
|
||||
|
||||
-- original bug query
|
||||
# original bug query
|
||||
SELECT * FROM
|
||||
t1
|
||||
NATURAL JOIN
|
||||
(t2 JOIN (t3 NATURAL JOIN t4, t5 NATURAL JOIN t6)
|
||||
ON (t3.id3 = t2.id3 AND t5.id5 = t2.id5));
|
||||
|
||||
-- inner join swapped
|
||||
# inner join swapped
|
||||
SELECT * FROM
|
||||
t1
|
||||
NATURAL JOIN
|
||||
(((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));
|
||||
|
||||
-- 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);
|
||||
|
||||
-- wrong error message: 'id2' - ambiguous column
|
||||
# wrong error message: 'id2' - ambiguous column
|
||||
SELECT * FROM
|
||||
(t2 JOIN (t3 NATURAL JOIN t4, t5 NATURAL JOIN t6)
|
||||
ON (t3.id3 = t2.id3 AND t5.id5 = t2.id5))
|
||||
|
@@ -1482,7 +1482,7 @@ INSERT INTO t1 (id) VALUES (NULL);
|
||||
SELECT * FROM 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
|
||||
(
|
||||
id INT PRIMARY KEY
|
||||
|
@@ -362,38 +362,38 @@ insert into t4 values (2, 3);
|
||||
insert into t5 values (11,4);
|
||||
insert into t6 values (2, 3);
|
||||
|
||||
-- Views with simple natural join.
|
||||
# Views with simple natural join.
|
||||
create algorithm=merge view v1a as
|
||||
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
|
||||
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
|
||||
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
|
||||
-- a->c->b, c->b->a, b->a->c
|
||||
# as above, but column names are cross-renamed, and aliased
|
||||
# a->c->b, c->b->a, b->a->c
|
||||
create algorithm=merge view v1d(b, a, c) as
|
||||
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
|
||||
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
|
||||
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;
|
||||
|
||||
-- Views with bigger natural join
|
||||
# Views with bigger natural join
|
||||
create algorithm=merge view v3a as
|
||||
select * from t1 natural join t2 natural join t3;
|
||||
create algorithm=merge view v3b as
|
||||
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
|
||||
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 left join (t3 natural join t4);
|
||||
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));
|
||||
-- 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 left join (t1 natural left join t2)) natural left join t4) natural left join t5;
|
||||
# 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 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 (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 ((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));
|
||||
@@ -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));
|
||||
|
||||
|
||||
-- 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)
|
||||
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)
|
||||
@@ -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)
|
||||
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.b > t2.b;
|
||||
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 (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 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 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;
|
||||
|
||||
-- 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 (t4 natural join t5) 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 (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.*, 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
|
||||
natural join
|
||||
(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
|
||||
(select * from t1 natural join t2) as t12;
|
||||
|
||||
-- Queries over views
|
||||
# Queries over views
|
||||
select * from v1a;
|
||||
select * from v1b;
|
||||
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 v1a join (t3 natural join t4) on a = y;
|
||||
|
||||
-- TODO: add tests with correlated subqueries for natural join/join on.
|
||||
-- related to BUG#15269
|
||||
# TODO: add tests with correlated subqueries for natural join/join on.
|
||||
# related to BUG#15269
|
||||
|
||||
|
||||
----------------------------------------------------------------------
|
||||
-- Negative tests (tests for errors)
|
||||
----------------------------------------------------------------------
|
||||
#--------------------------------------------------------------------
|
||||
# Negative tests (tests for errors)
|
||||
#--------------------------------------------------------------------
|
||||
-- error 1052
|
||||
select * from t1 natural join (t3 cross join t4); -- works in Oracle - bug
|
||||
-- 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);
|
||||
-- error 1052
|
||||
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
|
||||
select * from (t3 join (t4 natural join t5) on (b < z))
|
||||
natural join
|
||||
@@ -578,12 +578,12 @@ insert into t3 values (2,3);
|
||||
insert into t4 values (1,3);
|
||||
insert into t5 values (1,4);
|
||||
|
||||
-- this fails
|
||||
# this fails
|
||||
prepare stmt1 from "select * from ((t3 natural join (t1 natural join t2))
|
||||
natural join t4) natural join t5";
|
||||
execute stmt1;
|
||||
|
||||
-- this works
|
||||
# this works
|
||||
select * from ((t3 natural join (t1 natural join t2)) natural join t4)
|
||||
natural join t5;
|
||||
drop table t1, t2, t3, t4, t5;
|
||||
|
@@ -7,7 +7,7 @@ drop table if exists t1;
|
||||
--enable_warnings
|
||||
|
||||
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);
|
||||
update t1 set a=4 where b=1 limit 1;
|
||||
select * from t1;
|
||||
|
@@ -177,7 +177,7 @@ drop table t1;
|
||||
# non-null string collation, i.e. case insensitively,
|
||||
# rather than according to NULL's collation, i.e. case sensitively
|
||||
#
|
||||
-- in field
|
||||
# in field
|
||||
select
|
||||
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,
|
||||
|
@@ -2700,7 +2700,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);
|
||||
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(*)
|
||||
from t1 inner join (t3 left join t2 on t2.id = t3.b_id) on t1.id = t3.a_id;
|
||||
|
||||
@@ -2940,7 +2940,7 @@ create table t2 (
|
||||
insert into t1 (b,c) values (0,1), (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
|
||||
from t1 left outer join t2 on t1.a = t2.c and t2.b <> 1
|
||||
where t1.b <> 1 order by t1.a;
|
||||
|
@@ -209,7 +209,7 @@ select f3() //
|
||||
|
||||
call sp1() //
|
||||
|
||||
---------------
|
||||
# ---------------
|
||||
drop procedure sp1//
|
||||
drop function f3//
|
||||
|
||||
|
@@ -327,14 +327,14 @@ INSERT INTO t1 (col2) VALUES(CAST('0000-00-00' AS DATETIME));
|
||||
# SQLSTATE 22007 <invalid datetime value>
|
||||
--error 1292
|
||||
INSERT INTO t1 (col3) VALUES(CAST('0000-10-31 15:30' AS DATETIME));
|
||||
-- should return OK
|
||||
-- We accept this to be a failure
|
||||
# should return OK
|
||||
# We accept this to be a failure
|
||||
|
||||
--error 1292
|
||||
INSERT INTO t1 (col3) VALUES(CAST('2004-10-0 15:30' AS DATETIME));
|
||||
--error 1292
|
||||
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
|
||||
# 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>
|
||||
--error 1292
|
||||
INSERT INTO t1 (col3) VALUES(CONVERT('0000-10-31 15:30',DATETIME));
|
||||
-- should return OK
|
||||
-- We accept this to be a failure
|
||||
# should return OK
|
||||
# We accept this to be a failure
|
||||
|
||||
--error 1292
|
||||
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));
|
||||
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');
|
||||
|
||||
-- The 2 following inserts should generate a warning, but doesn't yet
|
||||
-- because NUMERIC works like DECIMAL
|
||||
# The 2 following inserts should generate a warning, but doesn't yet
|
||||
# because NUMERIC works like DECIMAL
|
||||
--error 1264
|
||||
INSERT INTO t1 VALUES (101.55);
|
||||
--error 1264
|
||||
@@ -744,8 +744,8 @@ INSERT INTO t1 VALUES (-101.55);
|
||||
INSERT INTO t1 VALUES (1010.55);
|
||||
--error 1264
|
||||
INSERT INTO t1 VALUES (1010);
|
||||
-- The 2 following inserts should generate a warning, but doesn't yet
|
||||
-- because NUMERIC works like DECIMAL
|
||||
# The 2 following inserts should generate a warning, but doesn't yet
|
||||
# because NUMERIC works like DECIMAL
|
||||
--error 1264
|
||||
INSERT INTO t1 VALUES ('101.55');
|
||||
--error 1264
|
||||
|
@@ -108,7 +108,7 @@ select * from t3 where a in (select a,b from t2);
|
||||
-- error 1241
|
||||
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);
|
||||
-- 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);
|
||||
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);
|
||||
@@ -2280,11 +2280,11 @@ drop table t1;
|
||||
# Bug#19700: subselect returning BIGINT always returned it as SIGNED
|
||||
#
|
||||
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);
|
||||
|
||||
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);
|
||||
|
||||
/* simple test */
|
||||
|
@@ -613,7 +613,7 @@ select truncate(99.999999999999999999999999999999999999,31);
|
||||
#-- should return 99.9999999999999999999999999999999
|
||||
#
|
||||
select truncate(99999999999999999999999999999999999999,-31);
|
||||
-- should return 90000000000000000000000000000000
|
||||
# should return 90000000000000000000000000000000
|
||||
#
|
||||
#-- 6. Set functions (AVG, SUM, COUNT) should work.
|
||||
#
|
||||
@@ -810,7 +810,7 @@ select 1 / 0;
|
||||
#BUG#6048 Stored procedure causes operating system reboot
|
||||
#BUG#6053 DOUBLE PRECISION literal
|
||||
|
||||
-- Tests from 'traditional' mode tests
|
||||
# Tests from 'traditional' mode tests
|
||||
#
|
||||
set sql_mode='ansi,traditional';
|
||||
#
|
||||
|
@@ -800,7 +800,7 @@ DROP DATABASE mysqltest1;
|
||||
CREATE TABLE t1 (a INT PRIMARY KEY);
|
||||
INSERT INTO t1 VALUES (1), (2), (3);
|
||||
CREATE DEFINER = 'no-such-user'@localhost VIEW v AS SELECT a from t1;
|
||||
--warning 1448
|
||||
#--warning 1448
|
||||
SHOW CREATE VIEW v;
|
||||
--error 1449
|
||||
SELECT * FROM v;
|
||||
|
@@ -33,7 +33,7 @@ fi
|
||||
|
||||
###########################################################################
|
||||
|
||||
client_args="--silent --socket=$socket_path "
|
||||
client_args="--silent --socket=$socket_path --connect_timeout=1 "
|
||||
|
||||
[ -n "$username" ] && client_args="$client_args --user=$username "
|
||||
[ -n "$password" ] && client_args="$client_args --password=$password "
|
||||
|
@@ -484,7 +484,7 @@ static int search_default_file(Process_option_func opt_handler,
|
||||
my_bool have_ext= fn_ext(config_file)[0] != 0;
|
||||
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;
|
||||
if ((error= search_default_file_with_ext(opt_handler, handler_ctx,
|
||||
@@ -672,7 +672,7 @@ static int search_default_file_with_ext(Process_option_func opt_handler,
|
||||
ext= fn_ext(search_file->name);
|
||||
|
||||
/* 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))
|
||||
break;
|
||||
@@ -861,7 +861,7 @@ void my_print_default_files(const char *conf_file)
|
||||
{
|
||||
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;
|
||||
char *end;
|
||||
|
13
mysys/hash.c
13
mysys/hash.c
@@ -53,7 +53,7 @@ _hash_init(HASH *hash,CHARSET_INFO *charset,
|
||||
void (*free_element)(void*),uint flags CALLER_INFO_PROTO)
|
||||
{
|
||||
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;
|
||||
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)
|
||||
{
|
||||
DBUG_ENTER("hash_free");
|
||||
DBUG_PRINT("enter",("hash: 0x%lxd",hash));
|
||||
DBUG_PRINT("enter",("hash: 0x%lxd", (long) hash));
|
||||
|
||||
hash_free_elements(hash);
|
||||
hash->free= 0;
|
||||
@@ -129,7 +129,7 @@ void hash_free(HASH *hash)
|
||||
void my_hash_reset(HASH *hash)
|
||||
{
|
||||
DBUG_ENTER("my_hash_reset");
|
||||
DBUG_PRINT("enter",("hash: 0x%lxd",hash));
|
||||
DBUG_PRINT("enter",("hash: 0x%lxd", (long) hash));
|
||||
|
||||
hash_free_elements(hash);
|
||||
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)
|
||||
{
|
||||
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;
|
||||
}
|
||||
else
|
||||
@@ -655,12 +656,12 @@ my_bool hash_check(HASH *hash)
|
||||
}
|
||||
if (found != records)
|
||||
{
|
||||
DBUG_PRINT("error",("Found %ld of %ld records"));
|
||||
DBUG_PRINT("error",("Found %u of %u records", found, records));
|
||||
error=1;
|
||||
}
|
||||
if (records)
|
||||
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));
|
||||
return error;
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user